Skip to content

Commit 4f2eea9

Browse files
authored
Add universe domain flag for event-exporter. (#889)
1 parent f4cdabf commit 4f2eea9

File tree

707 files changed

+125464
-47726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

707 files changed

+125464
-47726
lines changed

event-exporter/go.mod

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,41 @@ go 1.23.0
44

55
require (
66
cloud.google.com/go/compute v1.5.0
7-
github.com/golang/glog v1.2.2
8-
github.com/google/go-cmp v0.6.0
7+
github.com/golang/glog v1.2.4
8+
github.com/google/go-cmp v0.7.0
99
github.com/hashicorp/golang-lru/v2 v2.0.7
1010
github.com/prometheus/client_golang v1.21.1
11-
golang.org/x/net v0.38.0
11+
golang.org/x/net v0.39.0
1212
golang.org/x/time v0.11.0
13-
google.golang.org/api v0.70.0
13+
google.golang.org/api v0.231.0
1414
k8s.io/api v0.32.2
1515
k8s.io/apimachinery v0.32.2
1616
k8s.io/client-go v0.32.2
1717
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
1818
)
1919

2020
require (
21+
cloud.google.com/go/auth v0.16.1 // indirect
22+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
2123
github.com/beorn7/perks v1.0.1 // indirect
2224
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2325
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2426
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
27+
github.com/felixge/httpsnoop v1.0.4 // indirect
2528
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
2629
github.com/go-logr/logr v1.4.2 // indirect
30+
github.com/go-logr/stdr v1.2.2 // indirect
2731
github.com/go-openapi/jsonpointer v0.21.0 // indirect
2832
github.com/go-openapi/jsonreference v0.20.2 // indirect
2933
github.com/go-openapi/swag v0.23.0 // indirect
3034
github.com/gogo/protobuf v1.3.2 // indirect
31-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3235
github.com/golang/protobuf v1.5.4 // indirect
3336
github.com/google/gnostic-models v0.6.8 // indirect
3437
github.com/google/gofuzz v1.2.0 // indirect
38+
github.com/google/s2a-go v0.1.9 // indirect
3539
github.com/google/uuid v1.6.0 // indirect
36-
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
40+
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
41+
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
3742
github.com/josharian/intern v1.0.0 // indirect
3843
github.com/json-iterator/go v1.1.12 // indirect
3944
github.com/klauspost/compress v1.17.11 // indirect
@@ -47,15 +52,19 @@ require (
4752
github.com/prometheus/common v0.62.0 // indirect
4853
github.com/prometheus/procfs v0.15.1 // indirect
4954
github.com/x448/float16 v0.8.4 // indirect
50-
go.opencensus.io v0.23.0 // indirect
51-
golang.org/x/oauth2 v0.24.0 // indirect
52-
golang.org/x/sys v0.31.0 // indirect
53-
golang.org/x/term v0.30.0 // indirect
54-
golang.org/x/text v0.23.0 // indirect
55-
google.golang.org/appengine v1.6.7 // indirect
55+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
56+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
57+
go.opentelemetry.io/otel v1.35.0 // indirect
58+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
59+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
60+
golang.org/x/crypto v0.37.0 // indirect
61+
golang.org/x/oauth2 v0.29.0 // indirect
62+
golang.org/x/sys v0.32.0 // indirect
63+
golang.org/x/term v0.31.0 // indirect
64+
golang.org/x/text v0.24.0 // indirect
5665
google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8 // indirect
57-
google.golang.org/grpc v1.44.0 // indirect
58-
google.golang.org/protobuf v1.36.1 // indirect
66+
google.golang.org/grpc v1.72.0 // indirect
67+
google.golang.org/protobuf v1.36.6 // indirect
5968
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
6069
gopkg.in/inf.v0 v0.9.1 // indirect
6170
gopkg.in/yaml.v3 v3.0.1 // indirect

event-exporter/go.sum

Lines changed: 55 additions & 26 deletions
Large diffs are not rendered by default.

event-exporter/sinks/stackdriver/sink_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
defaultMaxBufferSize = 100
3030
defaultMaxConcurrency = 10
3131
defaultEndpoint = ""
32+
defaultUniverseDomain = "googleapis.com"
3233

3334
eventsLogName = "events"
3435
)
@@ -39,6 +40,7 @@ type sdSinkConfig struct {
3940
MaxConcurrency int
4041
LogName string
4142
Endpoint string
43+
UniverseDomain string
4244
}
4345

4446
// Provides Stackdriver sink default values for GCE instances.

event-exporter/sinks/stackdriver/sink_factory.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type sdSinkFactory struct {
3838
maxConcurrency *int
3939
resourceModelVersion *string
4040
endpoint *string
41+
universeDomain *string
4142
}
4243

4344
// NewSdSinkFactory creates a new Stackdriver sink factory.
@@ -54,7 +55,8 @@ func NewSdSinkFactory() sinks.SinkFactory {
5455
"concurrent requests to Stackdriver"),
5556
resourceModelVersion: fs.String("stackdriver-resource-model", "", "Stackdriver resource model "+
5657
"to be used for exports"),
57-
endpoint: fs.String("endpoint", defaultEndpoint, "Base path for Stackdriver API"),
58+
endpoint: fs.String("endpoint", defaultEndpoint, "Base path for Stackdriver API"),
59+
universeDomain: fs.String("universeDomain", defaultUniverseDomain, "The domain of the universe."),
5860
}
5961
}
6062

@@ -76,7 +78,7 @@ func (f *sdSinkFactory) CreateNew(opts []string, podLabelCollector podlabels.Pod
7678
}
7779

7880
ctx := context.Background()
79-
service, err := sd.NewService(ctx, option.WithEndpoint(config.Endpoint))
81+
service, err := sd.NewService(ctx, option.WithEndpoint(config.Endpoint), option.WithUniverseDomain(config.UniverseDomain))
8082
if err != nil {
8183
return nil, fmt.Errorf("failed to initialize Stackdriver service: %v", err)
8284
}
@@ -105,5 +107,6 @@ func (f *sdSinkFactory) createSinkConfig() (*sdSinkConfig, error) {
105107
config.MaxBufferSize = *f.maxBufferSize
106108
config.MaxConcurrency = *f.maxConcurrency
107109
config.Endpoint = *f.endpoint
110+
config.UniverseDomain = *f.universeDomain
108111
return config, nil
109112
}

0 commit comments

Comments
 (0)