[OTel] Add DD_TAGS resource-attribute test for OTLP trace metrics#7283
[OTel] Add DD_TAGS resource-attribute test for OTLP trace metrics#7283mabdinur wants to merge 5 commits into
Conversation
Add Test_FR08_AdditionalTags asserting global DD_TAGS surface as datadog.<key> resource attributes on the OTLP trace-metrics export, with reserved service/env/version/runtime_id keys ignored. The class is disabled (missing_feature) for python, nodejs, golang, and java until support lands in a future PR. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
…OURCE_ATTRIBUTES test DD_TAGS now surface as raw resource attributes (no datadog. prefix). Add test_fr08_11 covering OTEL_RESOURCE_ATTRIBUTES support. Both live in the already-gated Test_FR08_AdditionalTags class. Co-authored-by: Cursor <cursoragent@cursor.com>
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3270c85ce
ℹ️ 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".
|
|
||
| @scenarios.parametric | ||
| @features.client_side_stats_supported | ||
| class Test_FR08_AdditionalTags: |
There was a problem hiding this comment.
Mark additional-tags test missing for Ruby
For Ruby versions that satisfy manifests/ruby.yml's tests/parametric/test_otlp_trace_metrics.py: '>=2.35.0' rule, this new class has no Ruby-specific manifest entry, while the existing Ruby manifest still marks the explicit enablement test and all FR08 Datadog-attribute tests as missing_feature. That means Test_FR08_AdditionalTags becomes active for Ruby 2.35+ and will run with DEFAULT_ENVVARS, even though the trace-metrics export it depends on is still marked unsupported there, causing Ruby parametric runs to fail unless a matching Ruby manifest skip is added.
Useful? React with 👍 / 👎.
| "DD_TAGS": ( | ||
| "team:apm,tier:backend," | ||
| "service:ignored-svc,env:ignored-env,version:ignored-ver,runtime_id:ignored-rid" | ||
| ), |
There was a problem hiding this comment.
Exercise the reserved runtime-id tag
This test asserts that datadog.runtime-id is absent, but the only runtime tag it injects through DD_TAGS is runtime_id, so the hyphenated reserved-key check is vacuous. If an SDK filters runtime_id but still leaks DD_TAGS=runtime-id:... as datadog.runtime-id, this test would pass; include a runtime-id entry in DD_TAGS so the asserted reserved form is actually covered.
Useful? React with 👍 / 👎.
| : "irrelevant (\"Go tracer decided to always set _dd1.sr.eausr: 1 for truthy analytics.event inputs, else 0\")" | ||
| tests/parametric/test_otel_span_with_baggage.py::Test_Otel_Span_With_Baggage: missing_feature | ||
| tests/parametric/test_otlp_trace_metrics.py: missing_feature | ||
| tests/parametric/test_otlp_trace_metrics.py::Test_FR08_AdditionalTags: missing_feature (DD_TAGS are not yet emitted as datadog.<key> resource attributes; support coming in a future PR) |
There was a problem hiding this comment.
Quote manifest values containing angle brackets
The manifest syntax rule in .cursor/rules/pr-review.mdc requires values with special YAML characters such as < and > to be quoted. This new declaration contains <key> unquoted (and the same value was added in the Java, Node.js, and Python manifests), so it violates the repo's manifest format contract even though the current parser accepts it; quote the scalar to keep manifest formatting consistent.
Useful? React with 👍 / 👎.
Span tags named in DD_TRACE_STATS_ADDITIONAL_TAGS surface per-span as OTLP data-point attributes (their values vary per span, unlike the process-wide DD_TAGS carried on the resource). Lives in the already missing_feature-gated Test_FR08_AdditionalTags class. Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror the native stats encoding on the OTLP export: DD_TAGS surface as a tracer_dd_tags resource-attribute container and DD_TRACE_STATS_ADDITIONAL_TAGS as an additional_metric_tags data-point container (repeated key:value strings) rather than flat per-key attributes. Add arrayValue decoding to the OTLP attribute helper. Co-authored-by: Cursor <cursoragent@cursor.com>
OTEL_RESOURCE_ATTRIBUTES aliases DD_TAGS in the DD SDKs, so its entries surface in the same tracer_dd_tags resource-attribute container rather than as flat resource attributes. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Test_FR08_AdditionalTags::test_fr08_10_dd_tags_resource_attributestotests/parametric/test_otlp_trace_metrics.py, verifying that globalDD_TAGSare emitted asdatadog.<key>resource attributes on the OTLP trace-metrics export in default (non-OTel-semantics) mode.service/env/versionandruntime_id/runtime-idare ignored (they map to dedicated fields, notdatadog.<key>), and that aDD_TAGSservicevalue does not override the configuredservice.name.missing_featurefor python, nodejs, golang, and java; support will be added in a future PR.Test plan
Test_FR08_AdditionalTagsruns (and passes) for a tracer once DD_TAGS resource-attribute support is implemented.ruff format/ruff check/mypyclean on the test file.yamllint+ manifest parser validation pass.Made with Cursor