Skip to content

[OTel] Add DD_TAGS resource-attribute test for OTLP trace metrics#7283

Open
mabdinur wants to merge 5 commits into
mainfrom
munir/otlp-trace-metrics-additional-tags
Open

[OTel] Add DD_TAGS resource-attribute test for OTLP trace metrics#7283
mabdinur wants to merge 5 commits into
mainfrom
munir/otlp-trace-metrics-additional-tags

Conversation

@mabdinur

@mabdinur mabdinur commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Test_FR08_AdditionalTags::test_fr08_10_dd_tags_resource_attributes to tests/parametric/test_otlp_trace_metrics.py, verifying that global DD_TAGS are emitted as datadog.<key> resource attributes on the OTLP trace-metrics export in default (non-OTel-semantics) mode.
  • Asserts the reserved unified-service keys service/env/version and runtime_id/runtime-id are ignored (they map to dedicated fields, not datadog.<key>), and that a DD_TAGS service value does not override the configured service.name.
  • Disables the new class as missing_feature for python, nodejs, golang, and java; support will be added in a future PR.

Test plan

  • Test_FR08_AdditionalTags runs (and passes) for a tracer once DD_TAGS resource-attribute support is implemented.
  • Confirmed the class is skipped for python/nodejs/golang/java via the manifests.
  • ruff format/ruff check/mypy clean on the test file.
  • yamllint + manifest parser validation pass.

Made with Cursor

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>
@mabdinur mabdinur requested review from a team as code owners July 8, 2026 16:39
@mabdinur mabdinur requested review from BridgeAR, PerfectSlayer, avara1986, brettlangdon, claponcet and jandro996 and removed request for a team July 8, 2026 16:39
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/golang.yml                                                    @DataDog/dd-trace-go-guild
manifests/java.yml                                                      @DataDog/asm-java @DataDog/apm-java
manifests/nodejs.yml                                                    @DataDog/dd-trace-js
manifests/python.yml                                                    @DataDog/apm-python @DataDog/asm-python
tests/parametric/test_otlp_trace_metrics.py                             @DataDog/system-tests-core @DataDog/apm-sdk-capabilities

…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>
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jul 8, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

Testing the test | System Tests (ruby, prod) / parametric / parametric (1)   View in Datadog   GitHub Actions

🧪 3 Tests failed

tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags.test_fr08_10_dd_tags_resource_attributes[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
ValueError: Number (1) of metrics not available from test agent, got 0

self = &lt;tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags object at 0x7fb9987d4710&gt;
otlp_trace_metrics_library_env = {&#39;DD_SERVICE&#39;: &#39;test-otlp-stats-svc&#39;, &#39;DD_TAGS&#39;: &#39;team:apm,tier:backend,service:ignored-svc,env:ignored-env,version:ig...S_ENDPOINT&#39;: &#39;http://ddapm-test-agent-4316f7:4318/v1/metrics&#39;, &#39;OTEL_EXPORTER_OTLP_METRICS_PROTOCOL&#39;: &#39;http/json&#39;, ...}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fb9684cb440&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fb96811c410&gt;

    @pytest.mark.parametrize(
        &#34;library_env&#34;,
        [
...
tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags.test_fr08_11_otel_resource_attributes_env[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
ValueError: Number (1) of metrics not available from test agent, got 0

self = &lt;tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags object at 0x7fb9987e4590&gt;
otlp_trace_metrics_library_env = {&#39;DD_SERVICE&#39;: &#39;test-otlp-stats-svc&#39;, &#39;OTEL_EXPORTER_OTLP_METRICS_ENDPOINT&#39;: &#39;http://ddapm-test-agent-6f0143:4318/v1/m..._EXPORTER_OTLP_METRICS_PROTOCOL&#39;: &#39;http/json&#39;, &#39;OTEL_RESOURCE_ATTRIBUTES&#39;: &#39;team=apm,deployment.region=us-east-1&#39;, ...}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fb96811e210&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fb96859bc80&gt;

    @pytest.mark.parametrize(
        &#34;library_env&#34;,
        [{**DEFAULT_ENVVARS, &#34;OTEL_RESOURCE_ATTRIBUTES&#34;: &#34;team=apm,deployment.region=us-east-1&#34;}],
...
View all failed tests

Testing the test | System Tests (python, prod) / parametric / parametric (1)   View in Datadog   GitHub Actions

🧪 1 Test failed

tests.parametric.test_telemetry.Test_Defaults.test_library_settings[library_env0, parametric-python] from system_tests_suite   View in Datadog
AssertionError: No configuration found for any of DD_APPSEC_ENABLED with origin &#39;default&#39;
assert None is not None

self = &lt;tests.parametric.test_telemetry.Test_Defaults object at 0x7f8c74774a70&gt;
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f8c73ccd220&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f8c737b22a0&gt;

    @pytest.mark.parametrize(
        &#34;library_env&#34;,
        [
...

Testing the test | System Tests (ruby, dev) / parametric / parametric (2)   View in Datadog   GitHub Actions

🧪 3 Tests failed

tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags.test_fr08_10_dd_tags_resource_attributes[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
ValueError: Number (1) of metrics not available from test agent, got 0

self = &lt;tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags object at 0x7fed709e4050&gt;
otlp_trace_metrics_library_env = {&#39;DD_SERVICE&#39;: &#39;test-otlp-stats-svc&#39;, &#39;DD_TAGS&#39;: &#39;team:apm,tier:backend,service:ignored-svc,env:ignored-env,version:ig...S_ENDPOINT&#39;: &#39;http://ddapm-test-agent-20da6b:4318/v1/metrics&#39;, &#39;OTEL_EXPORTER_OTLP_METRICS_PROTOCOL&#39;: &#39;http/json&#39;, ...}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fed403a8650&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fed403a9d90&gt;

    @pytest.mark.parametrize(
        &#34;library_env&#34;,
        [
...
tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags.test_fr08_11_otel_resource_attributes_env[library_env0, parametric-ruby] from system_tests_suite   View in Datadog
ValueError: Number (1) of metrics not available from test agent, got 0

self = &lt;tests.parametric.test_otlp_trace_metrics.Test_FR08_AdditionalTags object at 0x7fed709c4e90&gt;
otlp_trace_metrics_library_env = {&#39;DD_SERVICE&#39;: &#39;test-otlp-stats-svc&#39;, &#39;OTEL_EXPORTER_OTLP_METRICS_ENDPOINT&#39;: &#39;http://ddapm-test-agent-ae9b70:4318/v1/m..._EXPORTER_OTLP_METRICS_PROTOCOL&#39;: &#39;http/json&#39;, &#39;OTEL_RESOURCE_ATTRIBUTES&#39;: &#39;team=apm,deployment.region=us-east-1&#39;, ...}
test_agent = &lt;utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fed40d36de0&gt;
test_library = &lt;utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fed409d7920&gt;

    @pytest.mark.parametrize(
        &#34;library_env&#34;,
        [{**DEFAULT_ENVVARS, &#34;OTEL_RESOURCE_ATTRIBUTES&#34;: &#34;team=apm,deployment.region=us-east-1&#34;}],
...
View all failed tests

View all 4 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 0 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c2a61a0 | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +1201 to +1204
"DD_TAGS": (
"team:apm,tier:backend,"
"service:ignored-svc,env:ignored-env,version:ignored-ver,runtime_id:ignored-rid"
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread manifests/golang.yml
: "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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

mabdinur and others added 3 commits July 8, 2026 12:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant