Skip to content

Commit

Permalink
ddtrace/tracer: noDebugStack config reports to telemetry under distin…
Browse files Browse the repository at this point in the history
…ct key debug_stack_enabled (#2798)
  • Loading branch information
mtoffl01 authored Jul 29, 2024
1 parent ec824d8 commit 70fa492
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ddtrace/tracer/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
6 changes: 4 additions & 2 deletions ddtrace/tracer/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit 70fa492

Please sign in to comment.