fix(metrics): match V3 resource mapping with Agent#1770
Conversation
…support' into rayz/metrics-v3-resource-mapping
Regression Detector (Agent Data Plane)Run ID: Optimization Goals: ✅ No significant changes detectedFine details of change detection per experiment (35)Experiments configured
Bounds Checks: ✅ Passed (5)
ExplanationA change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression ( |
There was a problem hiding this comment.
Pull request overview
Aligns Saluki’s Datadog V3 metrics encoding with the Datadog Agent’s resource mapping semantics, especially around promoting device:* and dd.internal.resource:* tags into V3 “resources” for series while keeping sketch behavior unchanged.
Changes:
- Updated V3 series encoding to promote
device:*and well-formeddd.internal.resource:<type>:<name>tags into resources (and remove them from tags), with resource ordering matching the Agent. - Updated V3 sketch encoding to not promote
device:*/dd.internal.resource:*tags (keeps them as tags) and only emithostas a resource. - Added unit tests asserting tag/resource behavior and ordering for series vs sketches.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fn is_v3_series_resource_tag(tag: &Tag) -> bool { | ||
| tag.name() == "dd.internal.resource" && tag.value().is_some() | ||
| } |
There was a problem hiding this comment.
Copilot sounds on point here, but I think all that matters is how Agent is doing it, which I'll leave to you to double check and fix here if necessary.
There was a problem hiding this comment.
Seems weird but it is what the Agent does. Agent only treats tags as internal resource tags if they start with dd.internal.resource: so dd.internal.resource would be kept
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c514b8369
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| fn is_v3_series_resource_tag(tag: &Tag) -> bool { | ||
| tag.name() == "dd.internal.resource" && tag.value().is_some() | ||
| } |
There was a problem hiding this comment.
Drop malformed internal resource tags from series
When a V3 series includes a malformed reserved tag with no value, such as the bare tag dd.internal.resource, this predicate returns false and the filter above keeps it as a normal metric tag. The previous starts_with("dd.internal.resource") filter dropped these reserved-prefix tags, and the commit message says malformed dd.internal.resource:* tags should be dropped; leaking them into the V3 tagset makes ADP diverge from the Agent behavior for malformed resource markers.
Useful? React with 👍 / 👎.
Binary Size Analysis (Agent Data Plane)Baseline: 1ad7cde · Comparison: 2c514b8 · diff ✅ Binary size difference within thresholdChanges by Module
Detailed Symbol Changes |
This comment has been minimized.
This comment has been minimized.
f27ed86
into
tobz/datadog-metrics-v3-payload-support
Summary
Match the Datadog Agent’s V3 resource mapping behavior for series and sketches.
For V3 series, this promotes resource-style tags into V3 resources:
device:<value>becomes adeviceresource and is removed from tags.dd.internal.resource:<type>:<name>tags become resources and are removed from tags.dd.internal.resource:*tags are dropped.host,device, then promoted resources.For V3 sketches, this keeps
device:*anddd.internal.resource:*as normal tags and only emitshostas a resource, matching the Agent sketch path.Change Type
How did you test this PR?
References