Skip to content

Commit

Permalink
chore: do not set Endpoint and Headers
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed Feb 15, 2024
1 parent a769566 commit 8d98ffe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 0 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ func (c *Config) InitDefault(log *zap.Logger) {
log.Warn("service_version is deprecated, use resource.service_version instead")
}

if c.Endpoint == "" {
// otlp default
c.Endpoint = "127.0.0.1:4318"
}

if c.Exporter == jaegerExp {
log.Warn("jaeger exporter is deprecated, use OTLP instead: https://github.com/roadrunner-server/roadrunner/issues/1699")
}
Expand Down
10 changes: 8 additions & 2 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,14 @@ func httpOptions(cfg *Config) []otlptracehttp.Option {
options = append(options, otlptracehttp.WithURLPath(cfg.CustomURL))
}

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

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

return options
}

0 comments on commit 8d98ffe

Please sign in to comment.