From 04c79859cb553a8c880d4e1ae4937a60de8aa215 Mon Sep 17 00:00:00 2001 From: Mikayla Toffler Date: Thu, 25 Jul 2024 16:13:47 -0400 Subject: [PATCH 1/3] changed telem name and logic --- ddtrace/tracer/telemetry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddtrace/tracer/telemetry.go b/ddtrace/tracer/telemetry.go index 7fec111383..1700f4fd69 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_disabled", 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}, From 78523b8e5675cb297f6952933cf4ecc4c20c4218 Mon Sep 17 00:00:00 2001 From: Mikayla Toffler Date: Thu, 25 Jul 2024 16:18:06 -0400 Subject: [PATCH 2/3] Changed telem name and wrote test --- ddtrace/tracer/telemetry.go | 2 +- ddtrace/tracer/telemetry_test.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ddtrace/tracer/telemetry.go b/ddtrace/tracer/telemetry.go index 1700f4fd69..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: "debug_stack_disabled", 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..f2109649fc 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,8 @@ 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, "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 +53,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") From 7ff59863b0ff624a03e1c66bdf690a1081e8b44a Mon Sep 17 00:00:00 2001 From: Mikayla Toffler Date: Mon, 29 Jul 2024 12:39:11 -0400 Subject: [PATCH 3/3] remove mistake duplicate test assertion --- ddtrace/tracer/telemetry_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ddtrace/tracer/telemetry_test.go b/ddtrace/tracer/telemetry_test.go index f2109649fc..6dee152e14 100644 --- a/ddtrace/tracer/telemetry_test.go +++ b/ddtrace/tracer/telemetry_test.go @@ -44,7 +44,6 @@ func TestTelemetryEnabled(t *testing.T) { assert.True(t, telemetryClient.Started) telemetryClient.AssertNumberOfCalls(t, "ApplyOps", 1) telemetry.Check(t, telemetryClient.Configuration, "trace_debug_enabled", true) - 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)