From 70fa4922e7c81e587c132bb743117fa5e1e90c6e Mon Sep 17 00:00:00 2001 From: Mikayla Toffler <46911781+mtoffl01@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:52:20 -0400 Subject: [PATCH] ddtrace/tracer: noDebugStack config reports to telemetry under distinct key debug_stack_enabled (#2798) --- ddtrace/tracer/telemetry.go | 2 +- ddtrace/tracer/telemetry_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ddtrace/tracer/telemetry.go b/ddtrace/tracer/telemetry.go index 7fec111383..3f9a7d2f33 100644 --- a/ddtrace/tracer/telemetry.go +++ b/ddtrace/tracer/telemetry.go @@ -48,7 +48,7 @@ func startTelemetry(c *config) { {Name: "agent_hostname", Value: c.hostname}, {Name: "runtime_metrics_enabled", Value: c.runtimeMetrics}, {Name: "dogstatsd_addr", Value: c.dogstatsdAddr}, - {Name: "trace_debug_enabled", Value: !c.noDebugStack}, + {Name: "debug_stack_enabled", Value: !c.noDebugStack}, {Name: "profiling_hotspots_enabled", Value: c.profilerHotspots}, {Name: "profiling_endpoints_enabled", Value: c.profilerEndpoints}, {Name: "trace_span_attribute_schema", Value: c.spanAttributeSchemaVersion}, diff --git a/ddtrace/tracer/telemetry_test.go b/ddtrace/tracer/telemetry_test.go index 9c3755b652..6dee152e14 100644 --- a/ddtrace/tracer/telemetry_test.go +++ b/ddtrace/tracer/telemetry_test.go @@ -23,12 +23,13 @@ func TestTelemetryEnabled(t *testing.T) { defer telemetry.MockGlobalClient(telemetryClient)() Start( - WithDebugStack(false), + WithDebugMode(true), WithService("test-serv"), WithEnv("test-env"), WithRuntimeMetrics(), WithPeerServiceMapping("key", "val"), WithPeerServiceDefaults(true), + WithDebugStack(false), WithHeaderTags([]string{"key:val", "key2:val2"}), WithSamplingRules( []SamplingRule{TagsResourceRule( @@ -42,7 +43,7 @@ func TestTelemetryEnabled(t *testing.T) { assert.True(t, telemetryClient.Started) telemetryClient.AssertNumberOfCalls(t, "ApplyOps", 1) - telemetry.Check(t, telemetryClient.Configuration, "trace_debug_enabled", false) + telemetry.Check(t, telemetryClient.Configuration, "trace_debug_enabled", true) telemetry.Check(t, telemetryClient.Configuration, "service", "test-serv") telemetry.Check(t, telemetryClient.Configuration, "env", "test-env") telemetry.Check(t, telemetryClient.Configuration, "runtime_metrics_enabled", true) @@ -51,6 +52,7 @@ func TestTelemetryEnabled(t *testing.T) { telemetry.Check(t, telemetryClient.Configuration, "trace_span_attribute_schema", 0) telemetry.Check(t, telemetryClient.Configuration, "trace_peer_service_defaults_enabled", true) telemetry.Check(t, telemetryClient.Configuration, "trace_peer_service_mapping", "key:val") + telemetry.Check(t, telemetryClient.Configuration, "debug_stack_enabled", false) telemetry.Check(t, telemetryClient.Configuration, "orchestrion_enabled", false) telemetry.Check(t, telemetryClient.Configuration, "trace_sample_rate", nil) // default value is NaN which is sanitized to nil telemetry.Check(t, telemetryClient.Configuration, "trace_header_tags", "key:val,key2:val2")