-
Notifications
You must be signed in to change notification settings - Fork 21
feat(stats)!: per-key cardinality limits #2211
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
base: main
Are you sure you want to change the base?
Changes from all commits
52710cf
a62a150
8f65b1d
a0bfe8c
6c6f058
a44467a
3113a7e
909d654
85eaf0c
05d2364
ed0277a
888e56c
9d91a3c
2342ce1
2d4eebc
9f7474e
35d265b
e082005
1c9dca9
43a1b0b
586e6d7
cc5bf3b
726c57a
bd6e3bc
1c46a80
04befd7
74f105a
edf1e0c
5cedcf4
83043a4
39427ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ use libdd_dogstatsd_client::new; | |
| use libdd_shared_runtime::SharedRuntime; | ||
| #[cfg(not(target_arch = "wasm32"))] | ||
| use libdd_shared_runtime::{BlockingRuntime, ForkSafeRuntime}; | ||
| use libdd_trace_stats::span_concentrator::CardinalityLimitConfig; | ||
| use libdd_trace_utils::trace_filter::TraceFilterer; | ||
| use std::sync::Arc; | ||
| use std::time::Duration; | ||
|
|
@@ -75,7 +76,7 @@ pub struct TraceExporterBuilder<R: SharedRuntime> { | |
| peer_tags_aggregation: bool, | ||
| compute_stats_by_span_kind: bool, | ||
| peer_tags: Vec<String>, | ||
| stats_cardinality_limit: Option<usize>, | ||
| stats_cardinality_limits: Option<CardinalityLimitConfig>, | ||
| #[cfg(feature = "stats-obfuscation")] | ||
| client_side_stats_obfuscation_enabled: bool, | ||
| #[cfg(feature = "telemetry")] | ||
|
|
@@ -143,7 +144,7 @@ impl<R: SharedRuntime> TraceExporterBuilder<R> { | |
| peer_tags_aggregation: false, | ||
| compute_stats_by_span_kind: false, | ||
| peer_tags: Vec::new(), | ||
| stats_cardinality_limit: None, | ||
| stats_cardinality_limits: None, | ||
| #[cfg(feature = "stats-obfuscation")] | ||
| client_side_stats_obfuscation_enabled: false, | ||
| #[cfg(feature = "telemetry")] | ||
|
|
@@ -333,8 +334,11 @@ impl<R: SharedRuntime> TraceExporterBuilder<R> { | |
| /// This bounds memory usage when the trace population has very high cardinality. | ||
| /// | ||
| /// Has no effect unless stats computation is enabled. | ||
| pub fn set_stats_cardinality_limit(&mut self, cardinality_limit: usize) -> &mut Self { | ||
| self.stats_cardinality_limit = Some(cardinality_limit); | ||
| pub fn set_stats_cardinality_limit( | ||
| &mut self, | ||
| cardinality_limits: CardinalityLimitConfig, | ||
| ) -> &mut Self { | ||
| self.stats_cardinality_limits = Some(cardinality_limits); | ||
| self | ||
| } | ||
|
|
||
|
|
@@ -820,7 +824,7 @@ impl<R: SharedRuntime> TraceExporterBuilder<R> { | |
| common_stats_tags: vec![libdatadog_version], | ||
| client_side_stats: StatsComputationConfig { | ||
| status: ArcSwap::new(stats.into()), | ||
| stats_cardinality_limit: self.stats_cardinality_limit, | ||
| stats_cardinality_limits: self.stats_cardinality_limits, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For exporters configured with OTLP metrics, the stats concentrator is created earlier with Useful? React with 👍 / 👎. |
||
| #[cfg(feature = "stats-obfuscation")] | ||
| obfuscation_config: Arc::new(ArcSwap::from_pointee( | ||
| StatsComputationObfuscationConfig::default(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.