feat(stats)!: per-field cardinality limits - #2211
feat(stats)!: per-field cardinality limits#2211gh-worker-dd-mergequeue-cf854d[bot] merged 42 commits into
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: e8ffd6e | Docs | Datadog PR Page | Give us feedback! |
|
@codex review |
a5a4786 to
2845fa8
Compare
2845fa8 to
fca0f65
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5a4786925
ℹ️ 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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d82ebfd172
ℹ️ 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".
abb8d3a to
efe280f
Compare
VianneyRuhlmann
left a comment
There was a problem hiding this comment.
LGTM, although I think we should make sure that this is shipped in the same release as the telemetry PR
…2170) # What does this PR do? - Add additional metric tags to the stats aggregation key. For each configured key, the matching span meta tag is included in the key and populates `ClientGroupedStats.additional_metric_tags`. - Limit the number of keys for `additional_metric_tags` to 4, not configurable. - Limit the maximum length of individual additional_metric_tags values to 200 characters, not configurable. Values exceeding this are replaced with `tracer_blocked_value`. # Motivation - Allow Serverless Compatibility Layer to send additional metric tags on trace stats. See [RFC](https://datadoghq.atlassian.net/wiki/spaces/APM/pages/6482919540/PENDING+Span-Derived+Primary+Tags+-+V1). - DataDog/serverless-components#140 to follow. - https://datadoghq.atlassian.net/browse/SVLS-8787 # Additional Notes Additional metric tags still need to be implemented in libdd-data-pipeline. Omitted from this PR since the goal of this PR is to support additional metric tags tags for Serverless without affecting other teams. https://github.com/DataDog/libdatadog/blob/42e3296aa3fa76749caf5d96b5bbf1ff2b1913b6/libdd-data-pipeline/src/trace_exporter/stats.rs#L146 Per-field cardinality limit for additional metric tags will be implemented in a following PR, #2211. - Limit the number of distinct aggregation entries per bucket that carry additional metric tags to 100 by default, configurable via `additional_metric_tags_max_entries`. Once exceeded, new entries have their tag values masked to `tracer_blocked_value`. --- Implementing additional metric tags instead of span derived primary tags. See previous PR for span derived primary tags - #1815. # How to test the change? - Unit tests - Deploy to Azure Functions with the following environment variables and validate that additional tags appear on trace metrics * `DD_TAGS: custom.primary:val,workload:azure_functions` * `DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED: true` * `DD_TRACE_STATS_ADDITIONAL_TAGS: custom.primary,workload` <img width="685" height="411" alt="Screenshot 2026-07-06 at 3 39 47 PM" src="https://github.com/user-attachments/assets/b91495b6-11aa-4051-922f-63655666c4e5" /> Co-authored-by: duncan.harvey <duncan.harvey@datadoghq.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2906b45c52
ℹ️ 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".
…-cardinality-limit
…-cardinality-limit
What does this PR do?
Implement per-key cardinality limits to stats computation.
Also:
[]->[tracer_blocked_value]encode_grouped_statsmeta with empty value:key:->key(breaking change ?)Motivation
CSS spec compliance.
Additional Notes
Todo:
How to test the change?