diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/DataStreamsMonitoringRabbitMQTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/DataStreamsMonitoringRabbitMQTests.cs index c30d7d85c92e..40f798519178 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/DataStreamsMonitoringRabbitMQTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/DataStreamsMonitoringRabbitMQTests.cs @@ -89,6 +89,12 @@ private static IList PayloadsToPoints(IImmutableList< } } - return points.OrderBy(s => s.Hash).ThenBy(s => s.TimestampType).ToList(); + // Stats points are aggregated by hash within 10-second buckets. If the sample crosses a + // bucket boundary, the same pathway can appear more than once in the collected payloads. + return points.GroupBy(s => new { s.Hash, s.ParentHash, s.TimestampType }) + .Select(g => g.First()) + .OrderBy(s => s.Hash) + .ThenBy(s => s.TimestampType) + .ToList(); } }