feat: implement additional metric tags for trace stats#140
Open
duncanpharvey wants to merge 7 commits into
Open
feat: implement additional metric tags for trace stats#140duncanpharvey wants to merge 7 commits into
duncanpharvey wants to merge 7 commits into
Conversation
6fae257 to
e38ada5
Compare
This comment has been minimized.
This comment has been minimized.
e38ada5 to
ec966d8
Compare
ec966d8 to
9ed7705
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Implements support for sending additional metric tags on trace stats by introducing new configuration settings (gated behind an experimental flag) and wiring them into the trace stats concentrator, along with updating the libdatadog dependency revision required for the feature.
Changes:
- Add
DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED,DD_TRACE_STATS_ADDITIONAL_TAGS, andDD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMITparsing to trace-agent config (with unit tests for gating). - Update stats concentrator creation to pass additional metric tags + optional cardinality limit, and introduce a hashable key wrapper for
TracerMetadata. - Bump libdatadog git revs across crates and update lockfile / third-party license list accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| LICENSE-3rdparty.csv | Adds newly introduced transitive dependencies to the third-party license inventory. |
| crates/datadog-trace-agent/src/trace_processor.rs | Updates tests/struct construction to include newly added config fields and payload field. |
| crates/datadog-trace-agent/src/stats_concentrator_service.rs | Passes additional metric tags + cardinality limit into SpanConcentrator and updates metadata keying. |
| crates/datadog-trace-agent/src/config.rs | Adds experimental flag + additional tag settings, with unit tests for gating behavior. |
| crates/datadog-trace-agent/Cargo.toml | Bumps libdatadog git revision to pick up required upstream changes. |
| crates/datadog-serverless-compat/Cargo.toml | Bumps libdatadog git revision for trace utils. |
| crates/datadog-metrics-collector/Cargo.toml | Bumps libdatadog git revision for common utilities. |
| crates/datadog-agent-config/Cargo.toml | Bumps libdatadog git revision for trace utils/obfuscation. |
| Cargo.lock | Locks new upstream libdatadog revisions and new transitive crates introduced by the update. |
Lewis-E
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
DD_TRACE_STATS_ADDITIONAL_TAGSsetting for adding additional tags to trace stats.DD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMITto limit number of distinct stats entries (default of 100 inlibdd-trace-statsif no value is passed).DD_TRACE_EXPERIMENTAL_FEATURES_ENABLEDto gate the behavior behindDD_TRACE_STATS_ADDITIONAL_TAGSandDD_TRACE_STATS_ADDITIONAL_TAGS_CARDINALITY_LIMIT.Motivation
Allow Serverless Compatibility Layer to send additional metric tags on trace stats. See RFC.
https://datadoghq.atlassian.net/browse/SVLS-8787
Additional Notes
Dependent on these changes in libdatadog: DataDog/libdatadog#2170
Describe how to test/QA your changes
DD_TRACE_EXPERIMENTAL_FEATURES_ENABLEDDD_TAGS: custom.primary:val,workload:azure_functionsDD_TRACE_EXPERIMENTAL_FEATURES_ENABLED: trueDD_TRACE_STATS_ADDITIONAL_TAGS: custom.primary,workload