-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rust): add some metrics backends #4063
base: master
Are you sure you want to change the base?
Conversation
05125cf
to
cb0a843
Compare
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #4063 +/- ##
=======================================
Coverage 90.34% 90.34%
=======================================
Files 803 803
Lines 39514 39514
Branches 245 245
=======================================
Hits 35698 35698
Misses 3784 3784
Partials 32 32 ☔ View full report in Codecov by Sentry. |
118a232
to
506ca85
Compare
for _ in 0..v.abs() { | ||
if v < 0 { | ||
self.client_sd.decr(key, &tags_str).unwrap(); | ||
} else { | ||
self.client_sd.incr(key, &tags_str).unwrap(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this logic be replaced by https://docs.rs/dogstatsd/latest/dogstatsd/struct.Client.html#method.count ?
Seems inefficient to send n
decr messages vs. subtract n
if that's possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that was so dumb. Updated.
2ff48c4
to
e04575f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would recommend using cadence instead of dogstatsd, and take a look at relay for how it is set up there
@@ -8,7 +8,12 @@ use std::collections::HashMap; | |||
use std::net::{ToSocketAddrs, UdpSocket}; | |||
use std::sync::Arc; | |||
|
|||
pub trait Metrics { | |||
pub trait MetricsClientTrait: Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not idiomatic to name traits as Trait
Switches the metrics client to be a trait and introduces a testing and datadog backend of the metrics client. Datadog is still WIP but this impl uses the dogstatsd library.