feat(stats)!: implement additional metric tags in libdd-trace-stats#2170
feat(stats)!: implement additional metric tags in libdd-trace-stats#2170duncanpharvey wants to merge 2 commits into
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: a7a73a5 | Docs | Datadog PR Page | Give us feedback! |
📚 Documentation Check Results📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🔒 Cargo Deny Results📦
|
c020593 to
82959f7
Compare
82959f7 to
9977516
Compare
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
|
fb6b20d to
b3d13e5
Compare
# What does this PR do? - Update protobufs to be in sync with datadog-agent * `containerDebug` * `additional_metric_tags` - Update `DATADOG_AGENT_TAG` for protobufs comparison to DataDog/datadog-agent@fdc29d4 # Motivation Out of sync protobufs with datadog-agent. Needed for #2170. # Additional Notes <img width="788" height="301" alt="Screenshot 2026-06-29 at 3 03 21 PM" src="https://github.com/user-attachments/assets/ac605731-2338-4919-a078-1cb31de9b2d0" /> # How to test the change? - Weekly test to compare protobufs to main: https://github.com/DataDog/libdatadog/actions/workflows/weekly-verify-proto-files.yml - Per PR test to compare protobugs to specified commit: https://github.com/DataDog/libdatadog/actions/workflows/verify-proto-files.yml Co-authored-by: duncan.harvey <duncan.harvey@datadoghq.com>
b3d13e5 to
def0a56
Compare
def0a56 to
42e3296
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42e3296aa3
ℹ️ 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".
42e3296 to
a7a73a5
Compare
# What does this PR do? - Update protobufs to be in sync with datadog-agent * `containerDebug` * `additional_metric_tags` - Update `DATADOG_AGENT_TAG` for protobufs comparison to DataDog/datadog-agent@fdc29d4 # Motivation Out of sync protobufs with datadog-agent. Needed for #2170. # Additional Notes <img width="788" height="301" alt="Screenshot 2026-06-29 at 3 03 21 PM" src="https://github.com/user-attachments/assets/ac605731-2338-4919-a078-1cb31de9b2d0" /> # How to test the change? - Weekly test to compare protobufs to main: https://github.com/DataDog/libdatadog/actions/workflows/weekly-verify-proto-files.yml - Per PR test to compare protobugs to specified commit: https://github.com/DataDog/libdatadog/actions/workflows/verify-proto-files.yml Co-authored-by: duncan.harvey <duncan.harvey@datadoghq.com> Signed-off-by: Taegyun Kim <taegyun.kim@datadoghq.com>
| /// Return an owned copy of this key with all additional metric tag values replaced by | ||
| /// `TRACER_BLOCKED_VALUE`. Used when the per-bucket additional-metric-tags cardinality limit | ||
| /// is exceeded. | ||
| pub(super) fn into_masked_owned(self) -> OwnedAggregationKey { | ||
| OwnedAggregationKey { | ||
| fixed: self.fixed.convert(str::to_owned), | ||
| peer_tags: self | ||
| .peer_tags | ||
| .iter() | ||
| .map(|(k, v)| (k.to_string(), v.to_string())) | ||
| .collect(), | ||
| additional_metric_tags: self | ||
| .additional_metric_tags | ||
| .iter() | ||
| .map(|(k, _)| (k.to_string(), TRACER_BLOCKED_VALUE.to_string())) | ||
| .collect(), | ||
| } |
There was a problem hiding this comment.
Per-field cardinality limit for additional tags could go into a follow up PR for consistency with how it's handled for the other fields.
I have an open PR to implement per-field cardinality limits: #2211
So if we merge yours before mine I can implement it in my pr for additional tags too (and I'll make sure to re-use your tests)
What does this PR do?
ClientGroupedStats.additional_metric_tags.additional_metric_tagsto 4, not configurable.additional_metric_tags_max_entries. Once exceeded, new entries have their tag values masked totracer_blocked_value.tracer_blocked_value.Motivation
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.
libdatadog/libdd-data-pipeline/src/trace_exporter/stats.rs
Line 146 in 42e3296
Implementing additional metric tags instead of span derived primary tags. See previous PR for span derived primary tags - #1815.
How to test the change?
DD_TAGS: custom.primary:val,workload:azure_functionsDD_TRACE_EXPERIMENTAL_FEATURES_ENABLED: trueDD_TRACE_STATS_ADDITIONAL_TAGS: custom.primary,workload