feat(stats)!: string field length limit#2267
Conversation
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73f237b8ac
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 4a2eefe | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5467cd14d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that 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
|
BenchmarksComparisonBenchmark execution time: 2026-07-23 10:49:53 Comparing candidate commit 4a2eefe in PR branch Found 2 performance improvements and 2 performance regressions! Performance is the same for 138 metrics, 0 unstable metrics.
|
| /// List of feature flags | ||
| pub feature_flags: Option<Vec<String>>, | ||
| #[serde(default)] | ||
| pub feature_flags: Vec<String>, |
There was a problem hiding this comment.
Is this related to the PR? Also, endpoints above is still an Option<Vec<String>>. Is that ok?
| } | ||
|
|
||
| /// Return true if the agent advertises support for the extended (15 KB) resource length limit. | ||
| fn is_big_resource_enabled(agent_info: &AgentInfo) -> bool { |
There was a problem hiding this comment.
Not sure, but do you think this could be a method on AgentInfo instead? Seems to not be really related to trace_exporter::stats specifically
| if max_len >= s.len() { | ||
| return s; | ||
| } | ||
| let mut idx = max_len; |
There was a problem hiding this comment.
| let mut idx = max_len; | |
| // TODO: use `floor_char_boundary` once our MSRV is 1.91 or higher | |
| // (https://doc.rust-lang.org/std/primitive.str.html#method.floor_char_boundary) | |
| let mut idx = max_len; |
| #[cfg(feature = "stats-obfuscation")] | ||
| let mut agg_key = agg_key; | ||
| #[cfg(feature = "stats-obfuscation")] | ||
| if target_bucket.obfuscated { | ||
| agg_key.truncate(self.big_resource); | ||
| } |
There was a problem hiding this comment.
| #[cfg(feature = "stats-obfuscation")] | |
| let mut agg_key = agg_key; | |
| #[cfg(feature = "stats-obfuscation")] | |
| if target_bucket.obfuscated { | |
| agg_key.truncate(self.big_resource); | |
| } | |
| #[cfg(feature = "stats-obfuscation")] | |
| { | |
| let mut agg_key = agg_key; | |
| if target_bucket.obfuscated { | |
| agg_key.truncate(self.big_resource); | |
| } | |
| } |
| } | ||
|
|
||
| /// Test that the SpanConcentrator truncates inserted span's fields after obfuscation is applied | ||
| #[duplicate_item( |
There was a problem hiding this comment.
Is this just to make a matrix of test? What's the advantage over just making big_resource and obfuscation parameters of one general test function my_test(big_resource: bool, obfuscation: bool), and then have 3 tests that just trivially call to this function with the expected parameters? It looks like a lot of magic and an additional dependency for something simple tbh (but maybe I'm misunderstanding what it does).
What does this PR do?
Implement the
String length limitssection of the cardinality limit RFC.Motivation
CSS spec compliance.
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.