Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: replace internal/telemetry by internal/newtelemetry #3136

Merged
merged 13 commits into from
Feb 20, 2025
Merged
11 changes: 4 additions & 7 deletions contrib/internal/httptrace/httptrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ import (
"strings"
"sync"

"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry"

"gopkg.in/DataDog/dd-trace-go.v1/ddtrace"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/baggage"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/DataDog/dd-trace-go.v1/internal"
"gopkg.in/DataDog/dd-trace-go.v1/internal/appsec/listener/httpsec"
"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/namingschema"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry"
)

var (
Expand All @@ -46,10 +45,8 @@ func StartRequestSpan(r *http.Request, opts ...ddtrace.StartSpanOption) (tracer.
// we cannot track the configuration in newConfig because it's called during init() and the the telemetry client
// is not initialized yet
reportTelemetryConfigOnce.Do(func() {
telemetry.GlobalClient.ConfigChange([]telemetry.Configuration{
{Name: "inferred_proxy_services_enabled", Value: cfg.inferredProxyServicesEnabled},
})
log.Debug("internal/httptrace: telemetry.ConfigChange called with cfg: %v:", cfg)
telemetry.RegisterAppConfig("inferred_proxy_services_enabled", cfg.inferredProxyServicesEnabled, telemetry.OriginEnvVar)
log.Debug("internal/httptrace: telemetry.RegisterAppConfig called with cfg: %v", cfg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this log? Debug mode is typically used by customers when troubleshooting some issue, but customers don't even have access to telemetry, so not sure we need it?

Copy link
Contributor Author

@eliottness eliottness Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not even be in the diff if not for the sed command I ran that changed it :)
Hopefully I do another PR after this one that fixes mistakes and gaps in our telemetry usage. I can include the removal of this line in this future PR 👍

})

var ipTags map[string]string
Expand Down
17 changes: 9 additions & 8 deletions contrib/internal/telemetrytest/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"

"gopkg.in/DataDog/dd-trace-go.v1/contrib/gorilla/mux"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry/telemetrytest"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

// TestIntegrationInfo verifies that an integration leveraging instrumentation telemetry
// sends the correct data to the telemetry client.
func TestIntegrationInfo(t *testing.T) {
// mux.NewRouter() uses the net/http and gorilla/mux integration
mux.NewRouter()
integrations := telemetry.Integrations()
require.Len(t, integrations, 2)
assert.Equal(t, integrations[0].Name, "net/http")
assert.True(t, integrations[0].Enabled)
assert.Equal(t, integrations[1].Name, "gorilla/mux")
assert.True(t, integrations[1].Enabled)
client := new(telemetrytest.RecordClient)
telemetry.StartApp(client)
_ = mux.NewRouter()

assert.Contains(t, client.Integrations, telemetry.Integration{Name: "net/http", Version: "", Error: ""})
assert.Contains(t, client.Integrations, telemetry.Integration{Name: "gorilla/mux", Version: "", Error: ""})
}

type contribPkg struct {
Expand Down
9 changes: 4 additions & 5 deletions ddtrace/opentelemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,15 @@ func TestTelemetry(t *testing.T) {
for k, v := range test.env {
t.Setenv(k, v)
}
telemetryClient := new(telemetrytest.MockClient)
defer telemetry.MockGlobalClient(telemetryClient)()
telemetryClient := new(telemetrytest.RecordClient)
defer telemetry.MockClient(telemetryClient)()

p := NewTracerProvider()
p.Tracer("")
defer p.Shutdown()

assert.True(t, telemetryClient.Started)
telemetry.Check(t, telemetryClient.Configuration, "trace_propagation_style_inject", test.expectedInject)
telemetry.Check(t, telemetryClient.Configuration, "trace_propagation_style_extract", test.expectedExtract)
assert.Contains(t, telemetryClient.Configuration, telemetry.Configuration{Name: "trace_propagation_style_inject", Value: test.expectedInject})
assert.Contains(t, telemetryClient.Configuration, telemetry.Configuration{Name: "trace_propagation_style_extract", Value: test.expectedExtract})
})
}

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/opentelemetry/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (t *oteltracer) Start(ctx context.Context, spanName string, opts ...oteltra
if k := ssConfig.SpanKind(); k != 0 {
ddopts = append(ddopts, tracer.Tag(ext.SpanKind, k.String()))
}
telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "spans_created", 1.0, telemetryTags, true)
telemetry.Count(telemetry.NamespaceTracers, "spans_created", telemetryTags).Submit(1.0)
var cfg ddtrace.StartSpanConfig
cfg.Tags = make(map[string]interface{})
for _, attr := range ssConfig.Attributes() {
Expand Down
7 changes: 3 additions & 4 deletions ddtrace/opentelemetry/tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,13 @@ func TestShutdownOnce(t *testing.T) {
}

func TestSpanTelemetry(t *testing.T) {
telemetryClient := new(telemetrytest.MockClient)
defer telemetry.MockGlobalClient(telemetryClient)()
telemetryClient := new(telemetrytest.RecordClient)
defer telemetry.MockClient(telemetryClient)()
tp := NewTracerProvider()
otel.SetTracerProvider(tp)
tr := otel.Tracer("")
_, _ = tr.Start(context.Background(), "otel.span")
telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "spans_created", 1.0, telemetryTags, true)
telemetryClient.AssertNumberOfCalls(t, "Count", 1)
assert.NotZero(t, telemetryClient.Count(telemetry.NamespaceTracers, "spans_created", telemetryTags).Get())
}

func TestConcurrentSetAttributes(_ *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ddtrace/opentracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry"

opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go"
)

// New creates, instantiates and returns an Opentracing compatible version of the
Expand Down Expand Up @@ -67,7 +67,7 @@ func (t *opentracer) StartSpan(operationName string, options ...opentracing.Star
for k, v := range sso.Tags {
opts = append(opts, tracer.Tag(k, v))
}
telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "spans_created", 1.0, telemetryTags, true)
telemetry.Count(telemetry.NamespaceTracers, "spans_created", telemetryTags).Submit(1.0)
return &span{
Span: t.Tracer.StartSpan(operationName, opts...),
opentracer: t,
Expand Down
7 changes: 3 additions & 4 deletions ddtrace/opentracer/tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ func TestExtractError(t *testing.T) {
}

func TestSpanTelemetry(t *testing.T) {
telemetryClient := new(telemetrytest.MockClient)
defer telemetry.MockGlobalClient(telemetryClient)()
telemetryClient := new(telemetrytest.RecordClient)
defer telemetry.MockClient(telemetryClient)()
opentracing.SetGlobalTracer(New())
_ = opentracing.StartSpan("opentracing.span")
telemetryClient.AssertCalled(t, "Count", telemetry.NamespaceTracers, "spans_created", 1.0, telemetryTags, true)
telemetryClient.AssertNumberOfCalls(t, "Count", 1)
assert.NotZero(t, telemetryClient.Count(telemetry.NamespaceTracers, "spans_created", telemetryTags).Get())
}
15 changes: 8 additions & 7 deletions ddtrace/tracer/dynamic_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ type dynamicConfig[T any] struct {

func newDynamicConfig[T any](name string, val T, apply func(T) bool, equal func(x, y T) bool) dynamicConfig[T] {
return dynamicConfig[T]{
cfgName: name,
current: val,
startup: val,
apply: apply,
equal: equal,
cfgName: name,
current: val,
startup: val,
cfgOrigin: telemetry.OriginDefault,
apply: apply,
equal: equal,
}
}

Expand Down Expand Up @@ -79,11 +80,11 @@ func (dc *dynamicConfig[T]) handleRC(val *T) bool {
func (dc *dynamicConfig[T]) toTelemetry() telemetry.Configuration {
dc.RLock()
defer dc.RUnlock()
return telemetry.Sanitize(telemetry.Configuration{
return telemetry.Configuration{
Name: dc.cfgName,
Value: dc.current,
Origin: dc.cfgOrigin,
})
}
}

func equal[T comparable](x, y T) bool {
Expand Down
2 changes: 2 additions & 0 deletions ddtrace/tracer/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig"
"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/osinfo"
telemetrylog "gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/version"
)

Expand Down Expand Up @@ -170,4 +171,5 @@ func logStartup(t *tracer) {
return
}
log.Info("DATADOG TRACER CONFIGURATION %s\n", string(bs))
telemetrylog.Debug("DATADOG TRACER CONFIGURATION %s\n", string(bs))
}
31 changes: 15 additions & 16 deletions ddtrace/tracer/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace"
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig"
"gopkg.in/DataDog/dd-trace-go.v1/internal/log"
"gopkg.in/DataDog/dd-trace-go.v1/internal/telemetry"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -30,7 +29,7 @@ func TestStartupLog(t *testing.T) {
defer stop()

tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
assert.Regexp(logPrefixRegexp+` INFO: DATADOG TRACER CONFIGURATION {"date":"[^"]*","os_name":"[^"]*","os_version":"[^"]*","version":"[^"]*","lang":"Go","lang_version":"[^"]*","env":"","service":"tracer\.test(\.exe)?","agent_url":"http://localhost:9/v0.4/traces","agent_error":"Post .*","debug":false,"analytics_enabled":false,"sample_rate":"NaN","sample_rate_limit":"disabled","trace_sampling_rules":null,"span_sampling_rules":null,"sampling_rules_error":"","service_mappings":null,"tags":{"runtime-id":"[^"]*"},"runtime_metrics_enabled":false,"runtime_metrics_v2_enabled":false,"profiler_code_hotspots_enabled":((false)|(true)),"profiler_endpoints_enabled":((false)|(true)),"dd_version":"","architecture":"[^"]*","global_service":"","lambda_mode":"false","appsec":((true)|(false)),"agent_features":{"DropP0s":((true)|(false)),"Stats":((true)|(false)),"StatsdPort":(0|8125)},"integrations":{.*},"partial_flush_enabled":false,"partial_flush_min_spans":1000,"orchestrion":{"enabled":false},"feature_flags":\[\],"propagation_style_inject":"datadog,tracecontext,baggage","propagation_style_extract":"datadog,tracecontext,baggage","tracing_as_transport":false,"dogstatsd_address":"localhost:8125"}`, tp.Logs()[1])
Expand Down Expand Up @@ -62,7 +61,7 @@ func TestStartupLog(t *testing.T) {
defer stop()

tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
assert.Regexp(logPrefixRegexp+` INFO: DATADOG TRACER CONFIGURATION {"date":"[^"]*","os_name":"[^"]*","os_version":"[^"]*","version":"[^"]*","lang":"Go","lang_version":"[^"]*","env":"configuredEnv","service":"configured.service","agent_url":"http://localhost:9/v0.4/traces","agent_error":"Post .*","debug":true,"analytics_enabled":true,"sample_rate":"0\.123000","sample_rate_limit":"100","trace_sampling_rules":\[{"service":"mysql","sample_rate":0\.75}\],"span_sampling_rules":null,"sampling_rules_error":"","service_mappings":{"initial_service":"new_service"},"tags":{"runtime-id":"[^"]*","tag":"value","tag2":"NaN"},"runtime_metrics_enabled":true,"runtime_metrics_v2_enabled":false,"profiler_code_hotspots_enabled":((false)|(true)),"profiler_endpoints_enabled":((false)|(true)),"dd_version":"2.3.4","architecture":"[^"]*","global_service":"configured.service","lambda_mode":"false","appsec":((true)|(false)),"agent_features":{"DropP0s":false,"Stats":false,"StatsdPort":(0|8125)},"integrations":{.*},"partial_flush_enabled":false,"partial_flush_min_spans":1000,"orchestrion":{"enabled":true,"metadata":{"version":"v1"}},"feature_flags":\["discovery"\],"propagation_style_inject":"datadog,tracecontext,baggage","propagation_style_extract":"datadog,tracecontext,baggage","tracing_as_transport":false,"dogstatsd_address":"localhost:8125"}`, tp.Logs()[1])
Expand Down Expand Up @@ -92,7 +91,7 @@ func TestStartupLog(t *testing.T) {
defer stop()

tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
assert.Regexp(logPrefixRegexp+` INFO: DATADOG TRACER CONFIGURATION {"date":"[^"]*","os_name":"[^"]*","os_version":"[^"]*","version":"[^"]*","lang":"Go","lang_version":"[^"]*","env":"configuredEnv","service":"configured.service","agent_url":"http://localhost:9/v0.4/traces","agent_error":"Post .*","debug":true,"analytics_enabled":true,"sample_rate":"0\.123000","sample_rate_limit":"1000.001","trace_sampling_rules":\[{"service":"mysql","sample_rate":0\.75}\],"span_sampling_rules":null,"sampling_rules_error":"","service_mappings":{"initial_service":"new_service"},"tags":{"runtime-id":"[^"]*","tag":"value","tag2":"NaN"},"runtime_metrics_enabled":true,"runtime_metrics_v2_enabled":false,"profiler_code_hotspots_enabled":((false)|(true)),"profiler_endpoints_enabled":((false)|(true)),"dd_version":"2.3.4","architecture":"[^"]*","global_service":"configured.service","lambda_mode":"false","appsec":((true)|(false)),"agent_features":{"DropP0s":false,"Stats":false,"StatsdPort":(0|8125)},"integrations":{.*},"partial_flush_enabled":false,"partial_flush_min_spans":1000,"orchestrion":{"enabled":false},"feature_flags":\[\],"propagation_style_inject":"datadog,tracecontext,baggage","propagation_style_extract":"datadog,tracecontext,baggage","tracing_as_transport":false,"dogstatsd_address":"localhost:8125"}`, tp.Logs()[1])
Expand All @@ -106,7 +105,7 @@ func TestStartupLog(t *testing.T) {
defer stop()

tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
fmt.Println(tp.Logs()[1])
Expand All @@ -120,7 +119,7 @@ func TestStartupLog(t *testing.T) {
defer stop()

tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
assert.Len(tp.Logs(), 1)
assert.Regexp(logPrefixRegexp+` INFO: DATADOG TRACER CONFIGURATION {"date":"[^"]*","os_name":"[^"]*","os_version":"[^"]*","version":"[^"]*","lang":"Go","lang_version":"[^"]*","env":"","service":"tracer\.test(\.exe)?","agent_url":"http://localhost:9/v0.4/traces","agent_error":"","debug":false,"analytics_enabled":false,"sample_rate":"NaN","sample_rate_limit":"disabled","trace_sampling_rules":null,"span_sampling_rules":null,"sampling_rules_error":"","service_mappings":null,"tags":{"runtime-id":"[^"]*"},"runtime_metrics_enabled":false,"runtime_metrics_v2_enabled":false,"profiler_code_hotspots_enabled":((false)|(true)),"profiler_endpoints_enabled":((false)|(true)),"dd_version":"","architecture":"[^"]*","global_service":"","lambda_mode":"true","appsec":((true)|(false)),"agent_features":{"DropP0s":false,"Stats":false,"StatsdPort":(0|8125)},"integrations":{.*},"partial_flush_enabled":false,"partial_flush_min_spans":1000,"orchestrion":{"enabled":false},"feature_flags":\[\],"propagation_style_inject":"datadog,tracecontext,baggage","propagation_style_extract":"datadog,tracecontext,baggage","tracing_as_transport":false,"dogstatsd_address":"localhost:8125"}`, tp.Logs()[0])
Expand All @@ -132,7 +131,7 @@ func TestStartupLog(t *testing.T) {
tracer, _, _, stop := startTestTracer(t, WithLogger(tp))
defer stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)

Expand All @@ -146,7 +145,7 @@ func TestStartupLog(t *testing.T) {
func TestLogSamplingRules(t *testing.T) {
assert := assert.New(t)
tp := new(log.RecordLogger)
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
t.Setenv("DD_TRACE_SAMPLING_RULES", `[{"service": "some.service", "sample_rate": 0.234}, {"service": "other.service"}, {"service": "last.service", "sample_rate": 0.56}, {"odd": "pairs"}, {"sample_rate": 9.10}]`)
_, _, _, stop := startTestTracer(t, WithLogger(tp), WithEnv("test"))
defer stop()
Expand All @@ -158,7 +157,7 @@ func TestLogSamplingRules(t *testing.T) {
func TestLogDefaultSampleRate(t *testing.T) {
assert := assert.New(t)
tp := new(log.RecordLogger)
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
log.UseLogger(tp)
t.Setenv("DD_TRACE_SAMPLE_RATE", ``)
_, _, _, stop := startTestTracer(t, WithLogger(tp), WithEnv("test"))
Expand All @@ -173,7 +172,7 @@ func TestLogAgentReachable(t *testing.T) {
tracer, _, _, stop := startTestTracer(t, WithLogger(tp))
defer stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
assert.Regexp(logPrefixRegexp+` WARN: DIAGNOSTICS Unable to reach agent intake: Post`, tp.Logs()[0])
Expand All @@ -186,7 +185,7 @@ func TestLogFormat(t *testing.T) {
tracer, _, _, stop := startTestTracer(t, WithLogger(tp), WithRuntimeMetrics(), WithDebugMode(true))
defer stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
tracer.StartSpan("test", ServiceName("test-service"), ResourceName("/"), WithSpanID(12345))
assert.Len(tp.Logs(), 1)
assert.Regexp(logPrefixRegexp+` DEBUG: Started Span: dd.trace_id="12345" dd.span_id="12345" dd.parent_id="0", Operation: test, Resource: /, Tags: map.*, map.*`, tp.Logs()[0])
Expand Down Expand Up @@ -257,7 +256,7 @@ func setup(t *testing.T, customProp Propagator) string {
}
defer stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
require.Len(t, tp.Logs(), 2)
return tp.Logs()[1]
Expand All @@ -278,7 +277,7 @@ func TestAgentURL(t *testing.T) {
tracer := newTracer(WithLogger(tp), WithUDS("var/run/datadog/apm.socket"))
defer tracer.Stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
logEntry, found := findLogEntry(tp.Logs(), `"agent_url":"unix://var/run/datadog/apm.socket"`)
if !found {
Expand All @@ -294,7 +293,7 @@ func TestAgentURLFromEnv(t *testing.T) {
tracer := newTracer(WithLogger(tp))
defer tracer.Stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
logEntry, found := findLogEntry(tp.Logs(), `"agent_url":"unix://var/run/datadog/apm.socket"`)
if !found {
Expand All @@ -311,7 +310,7 @@ func TestInvalidAgentURL(t *testing.T) {
tracer := newTracer(WithLogger(tp))
defer tracer.Stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
logEntry, found := findLogEntry(tp.Logs(), `"agent_url":"http://localhost:8126/v0.4/traces"`)
if !found {
Expand All @@ -328,7 +327,7 @@ func TestAgentURLConflict(t *testing.T) {
tracer := newTracer(WithLogger(tp), WithUDS("var/run/datadog/apm.socket"), WithAgentAddr("localhost:8126"))
defer tracer.Stop()
tp.Reset()
tp.Ignore("appsec: ", telemetry.LogPrefix)
tp.Ignore("appsec: ", "telemetry")
logStartup(tracer)
logEntry, found := findLogEntry(tp.Logs(), `"agent_url":"http://localhost:8126/v0.4/traces"`)
if !found {
Expand Down
4 changes: 2 additions & 2 deletions ddtrace/tracer/otel_dd_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func getDDorOtelConfig(configName string) string {
if val != "" {
log.Warn("Both %v and %v are set, using %v=%v", config.ot, config.dd, config.dd, val)
telemetryTags := []string{ddPrefix + strings.ToLower(config.dd), otelPrefix + strings.ToLower(config.ot)}
telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.hiding", 1.0, telemetryTags, true)
telemetry.Count(telemetry.NamespaceTracers, "otel.env.hiding", telemetryTags).Submit(1)
} else {
v, err := config.remapper(otVal)
if err != nil {
log.Warn("%v", err)
telemetryTags := []string{ddPrefix + strings.ToLower(config.dd), otelPrefix + strings.ToLower(config.ot)}
telemetry.GlobalClient.Count(telemetry.NamespaceTracers, "otel.env.invalid", 1.0, telemetryTags, true)
telemetry.Count(telemetry.NamespaceTracers, "otel.env.invalid", telemetryTags).Submit(1)
}
val = v
}
Expand Down
Loading
Loading