Skip to content

Commit

Permalink
only dedupe non-counters in prop test
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmith3197 committed Oct 5, 2023
1 parent e76e08c commit a1eb365
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sinks/datadog/metrics/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ mod tests {
let name = format!("{}-{}", value.as_name(), id);
Metric::new(name, MetricKind::Incremental, value).with_timestamp(Some(ts))
})
.filter(|metric| unique_metrics.insert(metric.series().clone())) // Filter out duplicates
// Filter out duplicates other than counters. We do this to prevent false positives. False positives would occur
// because we don't collapse other metric types and we can't sort metrics by their values.
.filter(|metric| {
matches!(metric.value(), MetricValue::Counter { .. })
|| unique_metrics.insert(metric.series().clone())
})
.collect()
})
}
Expand Down

0 comments on commit a1eb365

Please sign in to comment.