Skip to content

Commit 507fc6f

Browse files
authored
Do not inject DSM legacy headers by default (#7351)
## Summary of changes Reversed the default state of `IsDataStreamsLegacyHeadersEnabled` for `enabled by default` state. ## Reason for change See [ticket](https://datadoghq.atlassian.net/browse/APMS-16734)
1 parent e0b64ae commit 507fc6f

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ internal static class DataStreamsMonitoring
963963

964964
/// <summary>
965965
/// Configuration key for enabling legacy binary headers in Data Streams Monitoring.
966-
/// Default is true.
966+
/// false by default if DSM is in default state, true otherwise
967967
/// </summary>
968968
/// <see cref="TracerSettings.IsDataStreamsLegacyHeadersEnabled"/>
969969
public const string LegacyHeadersEnabled = "DD_DATA_STREAMS_LEGACY_HEADERS";

tracer/src/Datadog.Trace/Configuration/TracerSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,10 @@ internal TracerSettings(IConfigurationSource? source, IConfigurationTelemetry te
660660
.WithKeys(ConfigurationKeys.DataStreamsMonitoring.Enabled)
661661
.AsBool() == null;
662662

663+
// no legacy headers if we are in "enbaled by default" state
663664
IsDataStreamsLegacyHeadersEnabled = config
664665
.WithKeys(ConfigurationKeys.DataStreamsMonitoring.LegacyHeadersEnabled)
665-
.AsBool(true);
666+
.AsBool(!_isDataStreamsMonitoringInDefaultState);
666667

667668
IsRareSamplerEnabled = config
668669
.WithKeys(ConfigurationKeys.RareSamplerEnabled)

tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/AutoInstrumentation/AWS/Kinesis/ContextPropagationTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ public async Task InjectTraceIntoRecords_WithJsonString_AddsTraceContext()
148148
extractedTraceContext["x-datadog-parent-id"].Should().Be(scope?.Span.SpanId.ToString());
149149
extractedTraceContext["x-datadog-trace-id"].Should().Be(scope?.Span.TraceId.ToString());
150150
extractedTraceContext["dd-pathway-ctx-base64"].As<Newtonsoft.Json.Linq.JArray>().Should().HaveCount(1);
151-
extractedTraceContext["dd-pathway-ctx"].As<Newtonsoft.Json.Linq.JArray>().Should().HaveCount(1);
152151
}
153152

154153
[Fact]
@@ -203,7 +202,6 @@ public async Task InjectTraceIntoData_WithJsonString_AddsTraceContext()
203202
extractedTraceContext["x-datadog-parent-id"].Should().Be(scope?.Span.SpanId.ToString());
204203
extractedTraceContext["x-datadog-trace-id"].Should().Be(scope?.Span.TraceId.ToString());
205204
extractedTraceContext["dd-pathway-ctx-base64"].As<Newtonsoft.Json.Linq.JArray>().Should().HaveCount(1);
206-
extractedTraceContext["dd-pathway-ctx"].As<Newtonsoft.Json.Linq.JArray>().Should().HaveCount(1);
207205
}
208206

209207
[Fact]

tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ public void IsDataStreamsMonitoringEnabled(string value, bool expected)
979979
}
980980

981981
[Theory]
982-
[MemberData(nameof(BooleanTestCases), true)]
982+
[MemberData(nameof(BooleanTestCases), false)]
983983
public void IsDataStreamsLegacyHeadersEnabled(string value, bool expected)
984984
{
985985
var source = CreateConfigurationSource((ConfigurationKeys.DataStreamsMonitoring.LegacyHeadersEnabled, value));

0 commit comments

Comments
 (0)