feat(dogstatsd)!: add shared_runtime buffered sink#2224
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 955e832 | Docs | Datadog PR Page | Give us feedback! |
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
8eb7bc6 to
fed7da4
Compare
597364e to
b905f96
Compare
fed7da4 to
7bafd9b
Compare
b905f96 to
30d94f8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bafd9bcfa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
BenchmarksComparisonBenchmark execution time: 2026-07-22 13:08:29 Comparing candidate commit 955e832 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 140 metrics, 0 unstable metrics.
|
7bafd9b to
8f5b1cf
Compare
0e35cfd to
59810b1
Compare
30d94f8 to
395fb45
Compare
b3d9cd0 to
e981309
Compare
e981309 to
7709edc
Compare
395fb45 to
0c91d2d
Compare
7709edc to
9aa9b85
Compare
# What does this PR do? Refactor of the dogstatsd client crate. Main changes are: - Separated code in 3 modules, `action` `client` and `client/sink` - Renamed `Client` to `DogStatDClient` to avoid renames when importing in other crates - Move `new`, `create_client` and `do_send` to be method of the `DogStatsDClient` - Replaced Mutex in `DogStatsDClient` to use a `OnceLock` and make the client handle clonable # Motivation I've encountered several issues with the current design when sharing the client with the StatsExporter in #2159 and when adding the SharedRuntime backed client #2224 . # Additional Notes Anything else we should know when reviewing? # How to test the change? Describe here in detail how the change can be validated. Co-authored-by: vianney.ruhlmann <vianney.ruhlmann@datadoghq.com>
9aa9b85 to
955e832
Compare

What does this PR do?
Provide a SharedRuntime based buffered sink. The current
QueuingMetricSinkspawns a thread which isn't forksafe. This provides an alternative that can be used in forking context.Motivation
Currently the dogstatsd client doesn't survive a fork and all metrics submitted after the fork are never sent.
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.