Skip to content

ref(statsd): Migrate backend to metrics-exporter-dogstatsd#5675

Merged
Dav1dde merged 2 commits intomasterfrom
dav1d/dogstatsd-metrics
Mar 2, 2026
Merged

ref(statsd): Migrate backend to metrics-exporter-dogstatsd#5675
Dav1dde merged 2 commits intomasterfrom
dav1d/dogstatsd-metrics

Conversation

@Dav1dde
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde commented Feb 27, 2026

Migrates away from statsdproxy to metrics-exporter-dogstatsd from the metrics eco-system. This allows plugging into the much more powerful ecosystem of metrics. It also is a much more mature backend implementation.

Notable changes:

  • All sampling config has been removed. I am quite confident with this backend, reservoir sampling for all distributions and much better aggregation this won't be necessary anymore.
  • Aggregation is much more aggressive than before.
  • Distributions are now sampled, but instead of just using a sample rate, they are sampled using reservoir sampling
  • The client itself emits clients giving information about how much data was dropped. Logging is disabled because it is too spammy if something is wrong (e.g. missing socket).
  • The client no longer sends metrics in the 'hot path', this eliminates all socket syscalls we previously had in macro invocations
  • No more support for sets
  • Counters can only grow now, but gauges can be incremented and decremented
  • Removed support for some configurations which are either unused or are now always enabled (can't disable aggregation)
  • Actually good support for Unix Sockets.

While using the metrics eco-system, I kept our own facade alive, minimizing necessary changes on Relay. That said, it was still necessary to change some macro invocations (usually just small type changes).

@Dav1dde Dav1dde requested a review from a team as a code owner February 27, 2026 22:15
@Dav1dde Dav1dde force-pushed the dav1d/dogstatsd-metrics branch from 127376b to 0356496 Compare February 27, 2026 22:19
@Dav1dde Dav1dde self-assigned this Feb 27, 2026
cursor[bot]

This comment was marked as outdated.

@Dav1dde Dav1dde force-pushed the dav1d/dogstatsd-metrics branch 3 times, most recently from 25dc97a to 5713e86 Compare February 27, 2026 22:43
@Dav1dde Dav1dde force-pushed the dav1d/dogstatsd-metrics branch from 5713e86 to 1ad4af8 Compare February 27, 2026 22:55
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


let encoded_envelope = relay_statsd::metric!(
timer(RelayTimers::BufferEnvelopesSerialization, sample = 0.01),
timer(RelayTimers::BufferEnvelopesSerialization),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well have to verify that the buffer service load is still low.

CHANGELOG.md Outdated

**Breaking Changes**:

- Use a much more mature (dog)statsd backend, with proper support for unix sockets and reservoir sampling.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Use a much more mature (dog)statsd backend, with proper support for unix sockets and reservoir sampling.
- Use a more mature (dog)statsd backend, with proper support for unix sockets and reservoir sampling.

Let's be nice to the old backend

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, I was mostly referring to my botched version of the udp socket implementation, statsdproxy served us well!

@Dav1dde Dav1dde enabled auto-merge March 2, 2026 08:00
@Dav1dde Dav1dde added this pull request to the merge queue Mar 2, 2026
Merged via the queue into master with commit 57d90ab Mar 2, 2026
29 checks passed
@Dav1dde Dav1dde deleted the dav1d/dogstatsd-metrics branch March 2, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants