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

only enable protobuf instrumentation when DSM is enabled #6691

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static void EnrichActiveSpanWith(MessageDescriptorProxy? descriptor, st
var tracer = Tracer.Instance;

var settings = tracer.Settings;
if (!settings.IsIntegrationEnabled(IntegrationId.Protobuf))
if (!settings.IsDataStreamsMonitoringEnabled || !settings.IsIntegrationEnabled(IntegrationId.Protobuf))
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using Datadog.Trace.Configuration;
using Datadog.Trace.TestHelpers;
using FluentAssertions;
using FluentAssertions.Execution;
using VerifyXunit;
using Xunit;
Expand Down Expand Up @@ -69,4 +70,21 @@ await VerifyHelper.VerifySpans(
.DisableRequireUniquePrefix();
}
}

[Fact]
[Trait("Category", "EndToEnd")]
public async Task OnlyEnabledWithDsm()
{
SetEnvironmentVariable(ConfigurationKeys.DataStreamsMonitoring.Enabled, "0");
using var telemetry = this.ConfigureTelemetry();
using var agent = EnvironmentHelper.GetMockAgent();
using (await RunSampleAndWaitForExit(agent, $"{TestPrefix}"))
{
var spans = agent.WaitForSpans(2);
foreach (var span in spans)
{
span.Tags.Should().NotContain(t => t.Key.StartsWith("schema."));
}
}
}
}
Loading