Skip to content

Commit

Permalink
chore: do not set Endpoint and Headers for grpc
Browse files Browse the repository at this point in the history
This is applying the change from #60 to the grpc client.
  • Loading branch information
devnev authored Aug 16, 2024
1 parent 2c6862a commit 6fe9082
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,14 @@ func grpcOptions(cfg *Config) []otlptracegrpc.Option {
options = append(options, otlptracegrpc.WithCompressor("gzip"))
}

options = append(options, otlptracegrpc.WithEndpoint(cfg.Endpoint))
options = append(options, otlptracegrpc.WithHeaders(cfg.Headers))
// if unset, OTEL will use the default one automatically
if cfg.Endpoint != "" {
options = append(options, otlptracegrpc.WithEndpoint(cfg.Endpoint))
}

if len(cfg.Headers) > 0 {
options = append(options, otlptracegrpc.WithHeaders(cfg.Headers))
}

return options
}
Expand Down

0 comments on commit 6fe9082

Please sign in to comment.