Skip to content

test(otlp-trace-metrics): maintain parity with the OTEP spec - #7363

Merged
mabdinur merged 19 commits into
mainfrom
munir/otlp-trace-metrics-address-review-comments
Aug 5, 2026
Merged

test(otlp-trace-metrics): maintain parity with the OTEP spec#7363
mabdinur merged 19 commits into
mainfrom
munir/otlp-trace-metrics-address-review-comments

Conversation

@mabdinur

@mabdinur mabdinur commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates tests/parametric/test_otlp_trace_metrics.py to match the OTLP Trace Metrics RFC (SEMCON-1093) and adds manifest missing_feature skips so CI stays green while tracer implementations catch up.

Spec corrections:

  • datadog.tracer_tags / datadog.process_tags / datadog.peer_tags: single arrayValue of colon-joined "key:value" strings
  • service.name on every data point, including the configured default (test_fr06_15)
  • span.kind / status.code: Span Metrics Connector string convention (SPAN_KIND_*, STATUS_CODE_*)
  • additional_metric_tags: per-key unprefixed data-point attributes

Manifests: targeted skips in python, nodejs, java, and dotnet for gaps documented against current released SDKs. Skips are removed in a follow-up PR after the tracer fix PRs land:

Merge this before the tracer PRs so parametric CI pins the corrected spec.

Test plan

  • ./format.sh passes
  • Parametric OTLP jobs green (all SDKs) with skips in place

Resolves the mechanically-actionable open threads from PR #6834:
- FR02 mutual-exclusion test now also enables native stats computation
  explicitly, proving OTLP wins even when both mechanisms are turned on.
- FR01 test renamed to test_fr01_5_disabled_when_tracing_is_disabled,
  plus a new test_fr01_6 covering DD_APM_TRACING_ENABLED=false.
- span.kind casing is now tolerant of both "server" and "SERVER" pending
  spec finalization, via a new SPAN_KIND_SERVER_VALUES tuple.
- FR06 resource/span-name test now also asserts datadog.resource.name
  is absent, matching the module's "in both modes" claim.

Two open design questions (service.name repetition on data points, and
the OTel-semantics-mode attribute set) are flagged with docstring notes
rather than resolved, since they depend on the still-unfinalized OTEL
spec (RFC SEMCON-1093).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/dotnet.yml                                                    @DataDog/apm-dotnet @DataDog/asm-dotnet
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

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 22, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@mabdinur mabdinur changed the title test(otlp-trace-metrics): address open review comments from PR #6834 test(otlp-trace-metrics): maintain parity with the OTEP spec Jul 23, 2026
mabdinur and others added 6 commits July 23, 2026 14:30
…ty assertions

Resolves the two open design questions from PR #6834 review with concrete
decisions: service.name is now required on every data point, and OTel-
semantics mode is restricted to exactly the Span Metrics Connector's
default attribute set (service.name, span.name, span.kind, status.code).

Also narrows ERROR_STATUS_VALUES and SPAN_KIND_SERVER_VALUES to the SMC's
actual output format (STATUS_CODE_ERROR / SPAN_KIND_SERVER), based on
reading the SMC connector source and traceutil.go directly rather than
guessing at tolerant casing.

Verified live against TEST_LIBRARY=python: 4 tests fail against the
current Python implementation and are gated missing_feature in
manifests/python.yml (fr01_6, fr06_2, fr06_8, fr09_2), in addition to the
3 already-known gates for the service.name/SMC-attrs requirements.
…_trace_root spec

Reverts the SMC-parity restriction on OTel-semantics-mode attributes and the
unconditional service.name-on-every-data-point requirement from #7363, since
the RFC does not require either. Adds coverage for datadog.is_trace_root and
datadog.peer_tags (skipped pending test-agent support for a peer_tags
allowlist), and rewrites the process-tags test for the single
datadog.process_tags list-attribute shape. Drops the DD_TAGS /
OTEL_RESOURCE_ATTRIBUTES tests, which are now out of scope, along with their
now-stale manifest gates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… one list attribute

additional_metric_tags does not share peer_tags/process_tags' combined
colon-joined-list shape. Each DD_TRACE_STATS_ADDITIONAL_TAGS key surfaces as
its own data-point attribute (e.g. customer.tier=gold), with no datadog.
prefix and no additional_metric_tags container attribute.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tional_metric_tags container

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Remove new assertions that only check a value is absent (datadog.resource.name,
additional_metric_tags/datadog.<key> containers) -- they test for the absence of
alternate shapes rather than validating the spec's actual dimensions. Trim
duplicated "not asserted / implementations differ" doc caveats introduced
alongside them. No assertion on an existing/expected value changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
Verified locally against the merged dd-trace-py#18354 build:
datadog.process_tags is never emitted on OTLP trace metrics, and
DD_TRACE_STATS_ADDITIONAL_TAGS keys are not forwarded to the native
exporter at all. Mark both missing_feature until implemented.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mabdinur
mabdinur marked this pull request as ready for review August 4, 2026 18:09
@mabdinur
mabdinur requested review from a team as code owners August 4, 2026 18:09
@mabdinur
mabdinur requested review from MilanGarnier, claponcet, florentinl, manuel-alvarez-alvarez and ncybul and removed request for a team August 4, 2026 18:09
mabdinur and others added 3 commits August 4, 2026 14:14
…ments

ERROR_STATUS_VALUES and SPAN_KIND_SERVER_VALUES each held one literal
value; inline them directly in the assertions and drop the surrounding
explanatory comments to shrink the diff.

Co-authored-by: Cursor <cursoragent@cursor.com>
test_fr08_14_peer_tags is blocked on ddapm-test-agent support, not a
per-library gap, but manifests are the preferred activation mechanism.
Declare it missing_feature in python.yml and nodejs.yml (the only
manifests where the surrounding class isn't already skipped wholesale)
instead of an in-line @pytest.mark.skip.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ics-address-review-comments

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	manifests/java.yml
#	manifests/python.yml
#	tests/parametric/test_otlp_trace_metrics.py
The merge from main changed test_fr08_8_process_tags to check for
individual datadog.<key> resource attributes (matching JS/.NET), which
python already emits, so drop its now-stale missing_feature entry.
Add missing_feature entries for the three tests that now fail against
python: test_fr08_13_is_trace_root (emitted as _datadog.is_trace_root,
with a leading underscore) and the two new DD_TAGS/OTEL_RESOURCE_ATTRIBUTES
tracer_dd_tags tests (not yet reported for OTLP trace metrics).

Co-authored-by: Cursor <cursoragent@cursor.com>
@mabdinur

mabdinur commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

While implementing the dd-trace-js side of this spec (DataDog/dd-trace-js#9685), noticed test_fr08_8_process_tags's assertion body doesn't match its own docstring:

def test_fr08_8_process_tags(...):
    """Process tags surface as the resource attribute datadog.process_tags: an arrayValue of
    colon-joined "key:value" strings. ...
    """
    ...
    assert any(f"datadog.{tag}" in resource_attrs for tag in _PROCESS_TAG_KEYS), (
        f"Expected at least one datadog.<process-tag> resource attribute, got: {list(resource_attrs)}"
    )

The docstring (and the manifests/*.yml marker text) describes the new single-array datadog.process_tags shape, but the assertion still checks for the old per-key flattened shape (datadog.<tag>). Confirmed against a live payload from dd-trace-js emitting datadog.process_tags correctly — the test fails because it's looking for datadog.runtime-id/etc individually instead of checking "datadog.process_tags" in resource_attrs.

…spec, expand manifest skips

- test_fr08_8_process_tags: revert to checking the single combined
  datadog.process_tags arrayValue (the main merge had regressed it to
  check per-key datadog.<key> attributes, which no longer matches its
  own docstring; flagged in PR review comment 5183792859).
- test_fr08_10/test_fr08_11 (DD_TAGS / OTEL_RESOURCE_ATTRIBUTES): rename
  the expected resource attribute from tracer_dd_tags to
  datadog.tracer_tags, using the same colon-joined arrayValue shape as
  datadog.process_tags.
- Add/refresh missing_feature skips in python/nodejs/java/dotnet
  manifests based on the cross-repo OTLP trace-metrics findings audit
  and the latest CI run (span.kind canonicalization, status.code SMC
  string convention, is_trace_root wiring, process_tags shape,
  DD_APM_TRACING_ENABLED gating).

Co-authored-by: Cursor <cursoragent@cursor.com>
@mabdinur
mabdinur marked this pull request as ready for review August 5, 2026 04:40
@mabdinur
mabdinur requested review from a team as code owners August 5, 2026 04:40

@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: 7e08a9f299

ℹ️ 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".

Comment thread tests/parametric/test_otlp_trace_metrics.py
Comment thread tests/parametric/test_otlp_trace_metrics.py Outdated
Comment thread tests/parametric/test_otlp_trace_metrics.py Outdated
Comment thread tests/parametric/test_otlp_trace_metrics.py Outdated
Comment thread tests/parametric/test_otlp_trace_metrics.py Outdated
mabdinur and others added 5 commits August 5, 2026 01:06
Fix OTLP env/fixture usage in FR01/FR02/FR08 tests, normalize Java protobuf
payloads via _wait_for_otlp_metrics, align default service.name assertions with
spec, and register FFE_FLAG_CONFIGURATION_RULES for java >=1.64.2.

Co-authored-by: Cursor <cursoragent@cursor.com>
test_fr02_3 asserts Datadog-Client-Computed-Stats on native trace requests,
so keep DEFAULT_ENVVARS (not OTLP trace export) while still setting Java's
DD_TRACE_TRACER_METRICS_ENABLED alongside DD_TRACE_STATS_COMPUTATION_ENABLED.

Co-authored-by: Cursor <cursoragent@cursor.com>
Removed several tests marked as missing features from the golang manifest.

@mhlidd mhlidd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

mabdinur and others added 2 commits August 5, 2026 10:44
…hon fr06_7

Add golang missing_feature skips for the four parametric failures on
2.11.0-dev.1 and drop fr08_2/fr08_6 skips that XPASS on dev. Enable
python test_fr06_7_rpc_status_code at v4.14.0-dev once libdatadog v38 lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mabdinur
mabdinur merged commit ac0d9e2 into main Aug 5, 2026
848 of 850 checks passed
@mabdinur
mabdinur deleted the munir/otlp-trace-metrics-address-review-comments branch August 5, 2026 16:39
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.

2 participants