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 5 commits into
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 8280c19 | Docs | Datadog PR Page | Give us feedback! |
📚 Documentation Check Results📦
|
🔒 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>
a7a73a5 to
143f090
Compare
BenchmarksComparisonBenchmark execution time: 2026-07-15 16:53:39 Comparing candidate commit 8280c19 in PR branch Found 8 performance improvements and 1 performance regressions! Performance is the same for 132 metrics, 0 unstable metrics.
|
| .iter() | ||
| .filter_map(|key| match span.get_meta(key.as_str()) { | ||
| Some(v) if !v.is_empty() => { | ||
| if v.chars().count() > ADDITIONAL_METRIC_TAG_VALUE_MAX_LEN { |
There was a problem hiding this comment.
| if v.chars().count() > ADDITIONAL_METRIC_TAG_VALUE_MAX_LEN { | |
| if v.len() > ADDITIONAL_METRIC_TAG_VALUE_MAX_LEN { |
perf: Could we instead use byte length here instead ?
This deviates from the spec but I feel like this is a hot path and so we should avoid iterating on unbounded strings.
What does this PR do?
ClientGroupedStats.additional_metric_tags.additional_metric_tagsto 4, not configurable.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
Per-field cardinality limit for additional metric tags will be implemented in a following PR, #2211.
additional_metric_tags_max_entries. Once exceeded, new entries have their tag values masked totracer_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?
DD_TAGS: custom.primary:val,workload:azure_functionsDD_TRACE_EXPERIMENTAL_FEATURES_ENABLED: trueDD_TRACE_STATS_ADDITIONAL_TAGS: custom.primary,workload