Skip to content

test(otel): OTel HTTP semantics coverage against the cross-tracer RFC - #7455

Merged
link04 merged 5 commits into
mainfrom
otel-semantics-system-tests-v2
Aug 25, 2026
Merged

test(otel): OTel HTTP semantics coverage against the cross-tracer RFC#7455
link04 merged 5 commits into
mainfrom
otel-semantics-system-tests-v2

Conversation

@link04

@link04 link04 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds tests for HTTP OpenTelemetry semantic conventions enabled by DD_TRACE_OTEL_SEMANTICS_ENABLED and exported over OTLP.

Coverage includes HTTP server and client attributes, span naming and status (and custom error-status configuration), and trace metrics.

Scenarios

Scenario Test class Tests Coverage
OTEL_SEMANTICS_OTLP Test_OtelSemantics_Spans_Http_Server 19 Server attributes, naming, status semantics, URL handling, addressing, span kind, and endpoint retention
OTEL_SEMANTICS_OTLP Test_OtelSemantics_Spans_Http_Client 11 Client attributes, naming, status semantics, peer-service suppression, span kind, and URL redaction
OTEL_SEMANTICS_OTLP_CUSTOM_ERROR_STATUSES Test_OtelSemantics_OTLP_Spans_Http_ErrorStatusConfiguration 4 Configured client and server error-status ranges replace the defaults
OTEL_SEMANTICS_OTLP_TRACE_METRICS Test_OtelSemantics_OTLP_TraceMetrics 4 OTLP trace metrics agree with their corresponding HTTP spans
OTEL_SEMANTICS_OTLP_SAMPLING_RULES Test_OtelSemantics_SamplingRules 2 Semantic resource names are available when sampling decisions occur

Test_OtelSemantics_Spans_Http_Server

Test Description
test_otel_attributes_present Verifies canonical method, URL, and typed response-status attributes are present.
test_datadog_attributes_absent Verifies Datadog HTTP attribute aliases are omitted.
test_span_name_with_route Verifies a resolved low-cardinality route contributes to the span name.
test_span_name_route_invariance Verifies path-parameter values do not change the route or span name.
test_span_name_without_route Verifies an unresolved route never places the concrete URI path in the span name.
test_span_name_unknown_method Verifies unknown methods use _OTHER attributes and HTTP in the span name.
test_status_500_no_exception_is_status_code_error Verifies an HTTP 500 response marks the server span as an error.
test_status_400_is_not_error Verifies an HTTP 400 response does not mark a server span as an error.
test_status_3xx_is_not_error Verifies redirects do not mark server spans as errors.
test_url_query_present_with_query_string Verifies url.query is emitted when a query string is present.
test_url_query_absent_without_query_string Verifies url.query is omitted when no query string exists.
test_url_query_obfuscation Verifies sensitive query values are obfuscated.
test_user_agent Verifies the canonical original user-agent attribute.
test_client_address Verifies the canonical client address and removal of its Datadog alias.
test_network_peer_address Verifies the network peer address is available.
test_server_address Verifies the canonical server address and removal of its Datadog alias.
test_server_port Verifies server.port is emitted as an OTLP integer.
test_http_endpoint_retained Verifies the Datadog endpoint fallback remains available for route-less requests.
test_span_kind_is_server Verifies the OTLP span kind is SERVER.

Test_OtelSemantics_Spans_Http_Client

Test Description
test_otel_attributes_present Verifies canonical method, URL, server, and typed response-status attributes are present.
test_datadog_attributes_absent Verifies Datadog client HTTP aliases are omitted.
test_peer_service_suppressed Verifies peer-service defaults remain disabled in semantic-conventions mode.
test_span_name_is_method Verifies the client span name uses the normalized HTTP method without the URI path.
test_span_name_unknown_method Verifies unknown methods use _OTHER attributes and HTTP in the span name.
test_span_kind_is_client Verifies the OTLP span kind is CLIENT.
test_status_400_is_error Verifies an HTTP 400 response marks a client span as an error.
test_status_500_is_error Verifies an HTTP 500 response marks a client span as an error.
test_status_3xx_not_error Verifies redirects do not mark client spans as errors.
test_url_full_credential_redaction Verifies credentials embedded in url.full are removed or redacted.
test_url_full_query_obfuscation Verifies sensitive query values in url.full are obfuscated.

Test_OtelSemantics_OTLP_Spans_Http_ErrorStatusConfiguration

Test Description
test_server_error_statuses_config_overrides Verifies the configured server range can mark HTTP 200 as an error.
test_server_error_statuses_config_excludes_500 Verifies replacing the server range can exclude HTTP 500 from errors.
test_client_error_statuses_config_overrides Verifies the configured client range can mark HTTP 200 as an error.
test_client_error_statuses_config_excludes_500 Verifies replacing the client range can exclude HTTP 500 from errors.

Test_OtelSemantics_OTLP_TraceMetrics

Test Description
test_trace_metric_agrees_with_client_error Verifies an errored client metric matches the span method, status, name, kind, and error decision.
test_trace_metric_agrees_with_client_success Verifies a successful client metric matches the span and leaves status.code unset.
test_trace_metric_agrees_with_server_error Verifies an errored server metric matches the span method, status, name, kind, and error decision.
test_trace_metric_agrees_with_server_success Verifies a successful server metric matches the span and leaves status.code unset.

Test_OtelSemantics_SamplingRules

Test Description
test_otel_span_name_is_available_to_sampling_rules Verifies the normalized unknown-method resource matches its keep rule and every exported span is sampled.
test_server_span_name_is_available_before_client_sampling Verifies outbound propagation can sample the server trace and keep both server and client spans.

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 4, 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: 402c665 | Docs | View more details | Give us feedback!

Comment thread tests/test_otel_http_semantics.py
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py
Comment thread docs/understand/weblogs/end-to-end_weblog.md
Comment thread tests/test_otel_http_semantics.py Outdated
Comment thread tests/test_otel_http_semantics.py
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/test_otel_http_semantics.py                                       @DataDog/system-tests-core
.github/workflows/run-end-to-end.yml                                    @DataDog/system-tests-core
docs/understand/weblogs/end-to-end_weblog.md                            @DataDog/system-tests-core
manifests/c.yml                                                         @DataDog/system-tests-reviewers
manifests/cpp.yml                                                       @DataDog/system-tests-reviewers
manifests/cpp_httpd.yml                                                 @DataDog/system-tests-reviewers
manifests/cpp_kong.yml                                                  @DataDog/system-tests-reviewers
manifests/cpp_nginx.yml                                                 @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
manifests/rust.yml                                                      @DataDog/system-tests-reviewers
tests/otel/test_tracing_otlp.py                                         @DataDog/system-tests-core
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core
utils/build/docker/dotnet/weblog/Dependencies/HttpClientWrapper.cs      @DataDog/system-tests-reviewers
utils/build/docker/dotnet/weblog/Endpoints/MakeDistantCallEndpoint.cs   @DataDog/system-tests-reviewers
utils/build/docker/dotnet/weblog/Endpoints/ManualKeepDropEndpoint.cs    @DataDog/system-tests-reviewers
utils/build/docker/dotnet/weblog/Endpoints/OtelDropInEndpoint.cs        @DataDog/system-tests-reviewers
utils/build/docker/golang/app/net-http/main.go                          @DataDog/system-tests-reviewers
utils/build/docker/nodejs/express/app.js                                @DataDog/system-tests-reviewers
utils/build/docker/nodejs/express4-typescript/app.ts                    @DataDog/system-tests-reviewers
utils/build/docker/nodejs/fastify/app.js                                @DataDog/system-tests-reviewers
utils/build/docker/proxy.Dockerfile                                     @DataDog/system-tests-reviewers
utils/build/docker/python/django/app/urls.py                            @DataDog/system-tests-reviewers
utils/build/docker/python/fastapi/main.py                               @DataDog/system-tests-reviewers
utils/build/docker/python/flask/app.py                                  @DataDog/system-tests-reviewers
utils/build/docker/python/tornado/main.py                               @DataDog/system-tests-reviewers
utils/interfaces/_open_telemetry.py                                     @DataDog/system-tests-core
utils/proxy/traces/otlp_v1.py                                           @DataDog/system-tests-core

Comment thread tests/test_otel_http_semantics.py Outdated
@marcotc

marcotc commented Aug 20, 2026

Copy link
Copy Markdown
Member

@codex review

@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: 330d1e1e0f

ℹ️ 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/test_otel_http_semantics.py
Comment thread utils/build/docker/golang/app/net-http/main.go Outdated
@marcotc

marcotc commented Aug 20, 2026

Copy link
Copy Markdown
Member

@codex review

Comment thread tests/test_otel_http_semantics.py
Comment thread tests/test_otel_http_semantics.py
@tabgok
tabgok requested review from xlamorlette-datadog and removed request for tabgok August 21, 2026 12:43

@xlamorlette-datadog xlamorlette-datadog 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.

OK for the C++ part.

Co-authored-by: Ayan Khan <khanayan_123@hotmail.com>
Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
Co-authored-by: Maximo Bautista <max.bautista97@gmail.com>
@marcotc
marcotc force-pushed the otel-semantics-system-tests-v2 branch from 69d0136 to 39e8ffe Compare August 21, 2026 22:55
@marcotc

marcotc commented Aug 21, 2026

Copy link
Copy Markdown
Member

I rewrote commit history (!) to fix previous unsigned commits.

@marcotc
marcotc requested a review from a team as a code owner August 24, 2026 18:22
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.

5 participants