Shopify / statsd-instrument

A StatsD client for Ruby apps. Provides metaprogramming methods to inject StatsD instrumentation into your code.
http://shopify.github.io/statsd-instrument
MIT License
570 stars 94 forks source link

Aggregation: respect sampling for timings #378

Closed pedro-stanaka closed 1 week ago

pedro-stanaka commented 1 week ago

✅ What

Respect sampling when aggregation is enabled for timing types of metrics (histograms, distributions, ms, etc).

🤔 Why

Not having sampling enabled for timings totally beats the purpose of aggregation, since aggregation is only value packing the observations together. This behavior is used currently by Datadog in their implementation of user-space aggregation in golang: see code.

👩🔬 How to validate

Adding new test to test the new behavior, and old tests still pass.

Checklist