[Tracing] Implement initial OTLP traces weblog tests#6363
Draft
zacharycmontoya wants to merge 14 commits intomainfrom
Draft
[Tracing] Implement initial OTLP traces weblog tests#6363zacharycmontoya wants to merge 14 commits intomainfrom
zacharycmontoya wants to merge 14 commits intomainfrom
Conversation
…ple. Notably, this creates a new scenario APM_TRACING_OTLP to enable the environment variables needed to configure the SDK to export traces as OTLP.
…e only use the "/v1/metrics" subpath
Contributor
|
|
|
✨ Fix all issues with BitsAI or with Cursor
|
ida613
reviewed
Feb 24, 2026
ida613
reviewed
Feb 24, 2026
ida613
reviewed
Feb 24, 2026
…v, since users do not need this feature for OTLP export to work
…e we're not immediately implementing that
…ing specifically: - At runtime determine if the request is JSON - If JSON, look up proto field names by their camelCase representation. Otherwise, look up field names by their snake_case representation - If JSON, assert that the 'traceId' and 'spanId' fields are case-insensitive hexadecimal strings, rather than base64-encoded strings - If JSON, assert that enums (e.g. span.kind and span.status.code) are encoded using an integer, not a string representation of the enum value name - Regardless of protocol, get the time before and after the test HTTP request is issued, and assert that the span's reported 'start_time_unix_nano' and 'end_time_unix_nano' fall in this range - Regardless of protocol, make the 'http.method' and 'http.status_code' span attribute assertions more flexible by also testing against their stable OpenTelemetry HTTP equivalents of 'http.request.method' and 'http.response.status_code', respectively
cbeauchesne
reviewed
Mar 6, 2026
cbeauchesne
reviewed
Mar 6, 2026
| STATUS_CODE_ERROR = 2 | ||
|
|
||
|
|
||
| def get_keyvalue_generator(attributes: list[dict]) -> Iterator[tuple[str, Any]]: |
Collaborator
There was a problem hiding this comment.
I feel that data should be properly deserialized by the proxy, WDYT ?
Contributor
Author
There was a problem hiding this comment.
I prefer this approach where we add workarounds in order to access the request properly, because then we can still store the original contents of the request. And if there are any invalid fields that we try to assert against, it should be easy for the developer to debug this (the original request is saved to disk via the interface). Do you feel strongly that we should change this at the moment?
…ision of 0 is respected for OTLP traces by default
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.
Motivation
We are seeing increased demand for exporting traces as OTLP from our DD SDKs (rather than Datadog-proprietary MessagePack), so we are prototyping and establishing requirements for generating OTLP traces payloads. This is only the first of a series of PRs to establish clear expectations for what the generated OTLP traces and trace stats will look like.
Changes
APM_TRACING_OTLPscenario to test the weblog application with the configuration needed for the DD SDK to export traces using OTLP. This also adds ainclude_opentelemetryproperty to theEndToEndScenarioto set up the OpenTelemetry interface.tests/otel/test_tracing_otlp.py::Test_Otel_Tracing_OTLP::test_tracingto send a request to the weblog app usingweblog.get("/")and asserts properties of the OTLP trace payloadget_otel_spansandget_trace_statsto retrieve the OTLP payloads for test assertionsWorkflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present