diff --git a/Cargo.lock b/Cargo.lock index 404f4ddefcf..56c66836577 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4997,8 +4997,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "statsdproxy" version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1331025d2b2fd51955ddba105a3b66b558d5979c54fd690ec26f06f215abd2" +source = "git+https://github.com/getsentry/statsdproxy?rev=50155c5c5dc103fb1557e5ccde6b2cf6dfe82b9f#50155c5c5dc103fb1557e5ccde6b2cf6dfe82b9f" dependencies = [ "anyhow", "cadence", diff --git a/Cargo.toml b/Cargo.toml index 011923b0f27..35afcf5f380 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -169,7 +169,8 @@ smallvec = { version = "1.13.2", features = ["serde"] } socket2 = "0.5.8" sqlparser = "0.44.0" sqlx = { version = "0.8.2", default-features = false } -statsdproxy = { version = "0.2.0", default-features = false } +# See statsdproxy PR: https://github.com/getsentry/statsdproxy/pull/55 +statsdproxy = { git = "https://github.com/getsentry/statsdproxy", rev = "50155c5c5dc103fb1557e5ccde6b2cf6dfe82b9f", default-features = false} symbolic-common = { version = "12.12.3", default-features = false } symbolic-unreal = { version = "12.12.3", default-features = false } syn = { version = "2.0.90" } diff --git a/relay-statsd/src/lib.rs b/relay-statsd/src/lib.rs index 5712a86f29d..6c2a24d3cda 100644 --- a/relay-statsd/src/lib.rs +++ b/relay-statsd/src/lib.rs @@ -56,16 +56,16 @@ //! ``` //! //! [Metric Types]: https://github.com/statsd/statsd/blob/master/docs/metric_types.md -use std::collections::BTreeMap; -use std::net::ToSocketAddrs; -use std::ops::{Deref, DerefMut}; -use std::sync::Arc; - use cadence::{Metric, MetricBuilder, StatsdClient}; use parking_lot::RwLock; use rand::distributions::{Distribution, Uniform}; use statsdproxy::cadence::StatsdProxyMetricSink; use statsdproxy::config::AggregateMetricsConfig; +use std::collections::BTreeMap; +use std::net::ToSocketAddrs; +use std::ops::{Deref, DerefMut}; +use std::sync::Arc; +use std::time::Duration; /// Maximum number of metric events that can be queued before we start dropping them const METRICS_MAX_QUEUE_SIZE: usize = 100_000; @@ -253,7 +253,7 @@ pub fn init( AggregateMetricsConfig { aggregate_gauges: true, aggregate_counters: true, - flush_interval: 1, + flush_interval: Duration::from_millis(125), flush_offset: 0, max_map_size: None, },