mirror of https://github.com/docker/cli.git
Merge pull request #5025 from krissetto/fix-otel-otlp-override
Fix OTLP env var overriding
This commit is contained in:
commit
b31c9e1e0c
|
@ -41,10 +41,7 @@ func dockerExporterOTLPEndpoint(cli Cli) (endpoint string, secure bool) {
|
|||
otelCfg = m[otelContextFieldName]
|
||||
}
|
||||
|
||||
if otelCfg == nil {
|
||||
return "", false
|
||||
}
|
||||
|
||||
if otelCfg != nil {
|
||||
otelMap, ok := otelCfg.(map[string]any)
|
||||
if !ok {
|
||||
otel.Handle(errors.Errorf(
|
||||
|
@ -53,11 +50,10 @@ func dockerExporterOTLPEndpoint(cli Cli) (endpoint string, secure bool) {
|
|||
otelCfg,
|
||||
otelMap,
|
||||
))
|
||||
return "", false
|
||||
}
|
||||
|
||||
// keys from https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/
|
||||
endpoint, _ = otelMap[otelExporterOTLPEndpoint].(string)
|
||||
}
|
||||
|
||||
// Override with env var value if it exists AND IS SET
|
||||
// (ignore otel defaults for this override when the key exists but is empty)
|
||||
|
|
Loading…
Reference in New Issue