Skip to content

Commit

Permalink
[#62]: chore: do not set Endpoint and Headers for gRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored Aug 16, 2024
2 parents 2c6862a + 6fe9082 commit b4dcac2
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 b4dcac2

Please sign in to comment.