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

ddtrace/tracer: noDebugStack config reports to telemetry under distinct key debug_stack_enabled #2798

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 5 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,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)
Copy link
Member

Choose a reason for hiding this comment

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

@mtoffl01 Do we need to duplicate this check?

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 +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")
Expand Down
Loading