Skip to content

Commit 7c74848

Browse files
authored
Remove agent check in client-side-stats (#8503)
## Summary of changes Removes the minimum-agent version check from the client-side-stats check ## Reason for change We didn't have it before, which means people who previously had stats, suddenly won't have them. Also other agents (like bottlecap etc) don't have the version. And we haven't figured out how to handle that yet. While CSS is off by default, this seems like the best option to take. ## Implementation details Remove the code that is checking for CSS support. ## Test coverage Covered by existing (and removed a test for the behaviour) ## Other details Follows on from - #8417 - #8418 - #8420 - #8435 - #8436 - #8444 - #8445
1 parent b0f41b6 commit 7c74848

2 files changed

Lines changed: 2 additions & 36 deletions

File tree

tracer/src/Datadog.Trace/Agent/StatsAggregator.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -552,16 +552,8 @@ private void AddToBuffer(Span span)
552552

553553
private void HandleConfigUpdate(AgentConfiguration config)
554554
{
555-
// Client-side stats requires agent >= 7.65.0 which has full CSS v1.2.0 support.
556-
// However, if the version is not parseable (e.g. test agents returning "test"), we don't
557-
// block stats — the presence of the stats endpoint and client_drop_p0s is sufficient.
558-
559555
CanComputeStats = !string.IsNullOrWhiteSpace(config.StatsEndpoint)
560-
&& config.ClientDropP0s
561-
&& (config.AgentVersion is null
562-
|| !Version.TryParse(config.AgentVersion, out var parsedVersion)
563-
|| parsedVersion.Major >= 8
564-
|| (parsedVersion.Major == 7 && parsedVersion.Minor >= 65));
556+
&& config.ClientDropP0s;
565557

566558
if (CanComputeStats.Value)
567559
{

tracer/test/Datadog.Trace.Tests/Agent/StatsAggregatorTests.cs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,6 @@ public async Task CallFlushAutomatically()
7777
}
7878
}
7979

80-
[Theory]
81-
[InlineData("7.65.0", true)]
82-
[InlineData("7.66.0", true)]
83-
[InlineData("8.0.0", true)]
84-
[InlineData("7.64.0", false)]
85-
[InlineData("7.64.99", false)]
86-
[InlineData("7.0.0", false)]
87-
[InlineData("not-a-version", true)] // Unparseable versions don't block (e.g. test agents)
88-
[InlineData(null, true)] // Null version doesn't block
89-
public async Task StatsComputation_RequiresMinimumAgentVersion(string agentVersion, bool expectedEnabled)
90-
{
91-
var api = new Mock<IApi>();
92-
var discovery = new StubDiscoveryService(agentVersion);
93-
var aggregator = new StatsAggregator(api.Object, GetSettings(), discovery, isOtlp: false);
94-
95-
try
96-
{
97-
aggregator.CanComputeStats.Should().Be(expectedEnabled);
98-
}
99-
finally
100-
{
101-
await aggregator.DisposeAsync();
102-
}
103-
}
104-
10580
[Fact]
10681
public async Task EmptyBuckets()
10782
{
@@ -1367,7 +1342,6 @@ private static double ConvertTimestamp(long ns)
13671342
}
13681343

13691344
private class StubDiscoveryService(
1370-
string agentVersion = "7.65.0",
13711345
int obfuscationVersion = 0,
13721346
AgentTraceFilterConfig traceFilterConfig = null) : IDiscoveryService
13731347
{
@@ -1379,7 +1353,7 @@ public void SubscribeToChanges(Action<AgentConfiguration> callback)
13791353
debuggerV2Endpoint: "debuggerV2Endpoint",
13801354
diagnosticsEndpoint: "diagnosticsEndpoint",
13811355
symbolDbEndpoint: "symbolDbEndpoint",
1382-
agentVersion: agentVersion,
1356+
agentVersion: null,
13831357
statsEndpoint: "traceStatsEndpoint",
13841358
dataStreamsMonitoringEndpoint: "dataStreamsMonitoringEndpoint",
13851359
eventPlatformProxyEndpoint: "eventPlatformProxyEndpoint",

0 commit comments

Comments
 (0)