diff --git a/ddtrace/tracer/otel_dd_mappings.go b/ddtrace/tracer/otel_dd_mappings.go index 9af9b9478d..4800c2e480 100644 --- a/ddtrace/tracer/otel_dd_mappings.go +++ b/ddtrace/tracer/otel_dd_mappings.go @@ -89,14 +89,16 @@ func getDDorOtelConfig(configName string) string { val := os.Getenv(config.dd) if otVal := os.Getenv(config.ot); otVal != "" { + ddPrefix := "config.datadog:" + otelPrefix := "config.opentelemetry:" if val != "" { log.Warn("Both %v and %v are set, using %v=%v", config.ot, config.dd, config.dd, val) - telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.hiding", 1.0, []string{config.dd, config.ot}, true) + telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.hiding", 1.0, []string{ddPrefix + config.dd, otelPrefix + config.ot}, true) } else { v, err := config.remapper(otVal) if err != nil { log.Warn(err.Error()) - telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.invalid", 1.0, []string{config.dd, config.ot}, true) + telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.invalid", 1.0, []string{ddPrefix + config.dd, otelPrefix + config.ot}, true) } val = v } diff --git a/ddtrace/tracer/otel_dd_mappings_test.go b/ddtrace/tracer/otel_dd_mappings_test.go index 8cbaa3318f..1ecfb75149 100644 --- a/ddtrace/tracer/otel_dd_mappings_test.go +++ b/ddtrace/tracer/otel_dd_mappings_test.go @@ -36,7 +36,7 @@ func TestAssessSource(t *testing.T) { t.Setenv("OTEL_SERVICE_NAME", "123") v := getDDorOtelConfig("service") assert.Equal(t, "abc", v) - telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "otel.env.hiding", 1.0, []string{"DD_SERVICE", "OTEL_SERVICE_NAME"}, true) + telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "otel.env.hiding", 1.0, []string{"config.datadog:DD_SERVICE", "config.opentelemetry:OTEL_SERVICE_NAME"}, true) }) t.Run("invalid-ot", func(t *testing.T) { telemetryClient := new(telemetrytest.MockClient) @@ -44,6 +44,6 @@ func TestAssessSource(t *testing.T) { t.Setenv("OTEL_LOG_LEVEL", "nonesense") v := getDDorOtelConfig("debugMode") assert.Equal(t, "", v) - telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "otel.env.invalid", 1.0, []string{"DD_TRACE_DEBUG", "OTEL_LOG_LEVEL"}, true) + telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "otel.env.invalid", 1.0, []string{"config.datadog:DD_TRACE_DEBUG", "config.opentelemetry:OTEL_LOG_LEVEL"}, true) }) }