Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where grpc self-observability metrics were not added #900

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion exporter/collector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ func setVersionInUserAgent(cfg *Config, version string) {
}

func generateClientOptions(ctx context.Context, clientCfg *ClientConfig, cfg *Config, scopes []string, meterProvider metric.MeterProvider) ([]option.ClientOption, error) {
var copts []option.ClientOption
// Disable the built-in telemetry so we have full control over the telemetry produced.
copts := []option.ClientOption{
option.WithTelemetryDisabled(),
option.WithGRPCDialOption(otelgrpc.DialOption(otelgrpc.Options{
MetricsOptions: otelgrpc.MetricsOptions{
MeterProvider: meterProvider,
},
})),
}
// grpc.WithUserAgent is used by the Trace exporter, but not the Metric exporter (see comment below)
if cfg.UserAgent != "" {
copts = append(copts, option.WithGRPCDialOption(grpc.WithUserAgent(cfg.UserAgent)))
Expand Down
Loading