test(otlp-trace-metrics): maintain parity with the OTEP spec - #7363
Draft
mabdinur wants to merge 2 commits into
Draft
test(otlp-trace-metrics): maintain parity with the OTEP spec#7363mabdinur wants to merge 2 commits into
mabdinur wants to merge 2 commits into
Conversation
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>
Contributor
|
|
|
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #6834 (already merged). This addresses the review threads on that PR that were left unresolved.
Resolved with concrete test changes:
Test_FR02_Mutual_Exclusion.test_fr02_3_otlp_suppresses_native_statsnow also setsDD_TRACE_STATS_COMPUTATION_ENABLED=1, proving OTLP wins even when native stats computation is explicitly enabled too (not just left at default) — directly answers "what happens if both are true, which one wins?"test_fr01_5_disabled_when_traces_exporter_not_otlprenamed totest_fr01_5_disabled_when_tracing_is_disabled, plus a newtest_fr01_6_disabled_when_apm_tracing_disabledcoveringDD_APM_TRACING_ENABLED=false(APM standalone mode).test_fr06_1_resource_span_namenow also assertsdatadog.resource.nameis absent, matching the module docstring's claim that it's never emitted in either mode.test_fr06_9_service_env_versionandtest_fr06_14_custom_service_on_data_pointnow assertservice.nameis present on every data point, matching the OTel Span Metrics Connector, which always attaches it as one of its default dimensions — regardless of whether it matches the resource's default service.test_fr07_3_otel_attributes_present(which asserted extra OTel semantic-convention attributes likehttp.*WERE present) is replaced bytest_fr07_3_only_smc_default_attributes, which asserts data points carry onlyservice.name,span.name,span.kind,status.code— the Span Metrics Connector's real default dimensions — and nothing else.span.kindandstatus.codevalues are narrowed to the SMC's actual output format, based on reading the SMC connector source andtraceutil.godirectly:status.codemust be exactly"STATUS_CODE_ERROR"(a string) — the previously-tolerated bare"ERROR"and integer2don't correspond to any real SMC output for this key by default (those only appear under a different, feature-gatedotel.status_codekey).span.kindmust be exactly"SPAN_KIND_SERVER"— the previously-tolerated"server"/"SERVER"casing doesn't match the SMC's own convention.Verified against the real Python tracer (not just collected — actually run):
TEST_LIBRARY=python. 4 tests fail against the current Python implementation and are now gatedmissing_featureinmanifests/python.yml:test_fr01_6_disabled_when_apm_tracing_disabled— OTLP trace metrics are still emitted whenDD_APM_TRACING_ENABLED=false.test_fr06_2_span_kind— emits the raw Datadog value ("server"), notSPAN_KIND_SERVER.test_fr06_8_status_code_error— emitsstatus.codeas the integer2, not"STATUS_CODE_ERROR".test_fr09_2_error_count— depends on the samestatus.codeformat gap, so the error span isn't counted.test_fr06_9/test_fr06_14/test_fr07_3_only_smc_default_attributeswere already known-failing (service.name / SMC-only-attrs are genuinely new requirements) and were already gated.manifests/nodejs.ymlcarries the same 3 known-certain gates (test_fr06_9,test_fr06_14,test_fr07_3_only_smc_default_attributes) as a starting point — CI will surface if it also needs thespan.kind/status.code/fr01_6gates.Why draft
Marked draft on purpose. The service.name and OTel-semantics-mode design decisions above are now resolved and encoded in the tests, but this should still land after the OTEL spec (RFC SEMCON-1093) is finalized, since it's the authoritative source these tests are meant to track.
Test plan
ruff format --check/ruff checkpassmypypasses./run.sh PARAMETRIC --collect-only --scenario-report -k test_otlp_trace_metricscollects all 52 tests cleanly./run.sh PARAMETRIC -k test_otlp_trace_metricsrun live againstTEST_LIBRARY=python; all non-gated tests pass, gated tests xfail as expected🤖 Generated with Claude Code