Skip to content

Explicit hexadecimal span_id#6641

Open
cbeauchesne wants to merge 9 commits intomainfrom
cbeauchesne/otel_span_id
Open

Explicit hexadecimal span_id#6641
cbeauchesne wants to merge 9 commits intomainfrom
cbeauchesne/otel_span_id

Conversation

@cbeauchesne
Copy link
Copy Markdown
Collaborator

@cbeauchesne cbeauchesne commented Mar 30, 2026

Motivation

otel span id was returned either:

  1. an integer,
  2. or an hexadecimal string,
  3. or a decimal string.

The heuristic to determine between 2. and 3. was the presence of one of abcdef. Brittle ...

Changes

otel span id can be one of :

  1. an integer
  2. or a string, explicitly starting with 0x, which is a hexadecimal number

And nothing else.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

CODEOWNERS have been resolved as:

tests/parametric/test_otel_api_interoperability.py                      @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
tests/parametric/test_otel_span_methods.py                              @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
utils/build/docker/dotnet/parametric/Endpoints/ApmTestApiOtel.cs        @DataDog/apm-dotnet @DataDog/asm-dotnet @DataDog/system-tests-core
utils/build/docker/golang/parametric/helpers.go                         @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/parametric/otel.go                            @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/java/parametric/src/main/java/com/datadoghq/trace/opentelemetry/controller/OpenTelemetryTraceController.java  @DataDog/apm-java @DataDog/asm-java @DataDog/system-tests-core
utils/build/docker/java/parametric/src/main/java/com/datadoghq/trace/opentelemetry/dto/SpanContextResult.java  @DataDog/apm-java @DataDog/asm-java @DataDog/system-tests-core
utils/build/docker/nodejs/parametric/server.js                          @DataDog/dd-trace-js @DataDog/system-tests-core
utils/build/docker/php/parametric/server.php                            @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/python/parametric/apm_test_client/server.py          @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/ruby/parametric/server.rb                            @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/rust/parametric/src/opentelemetry/dto.rs             @DataDog/apm-rust @DataDog/system-tests-core
utils/build/docker/rust/parametric/src/opentelemetry/mod.rs             @DataDog/apm-rust @DataDog/system-tests-core
utils/docker_fixtures/_test_clients/_test_client_parametric.py          @DataDog/system-tests-core
utils/docker_fixtures/parametric.py                                     @DataDog/system-tests-core
utils/docker_fixtures/spec/trace.py                                     @DataDog/system-tests-core

@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 bot commented Mar 30, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 18 Tests failed

tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability.test_concurrent_traces_nested_dd_root[library_env0, parametric-php] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: assert '5005180949742340631' == '0x4575f98e21f1ca17'
  - 0x4575f98e21f1ca17
  + 5005180949742340631

self = <tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability object at 0x7f49ed714bc0>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7f49bb1bc2f0>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7f49bb4352e0>

    def test_concurrent_traces_nested_dd_root(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        """- Concurrent traces with nested start/end, with the first trace being opened with the Datadog API"""
...
tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability.test_concurrent_traces_nested_dd_root[library_env0, parametric-php] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: assert '12467549885003531104' == '0xad05a29083190360'
  - 0xad05a29083190360
  + 12467549885003531104

self = <tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability object at 0x7fc58d9c7d40>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fc55b3ad0d0>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fc55b3af800>

    def test_concurrent_traces_nested_dd_root(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        """- Concurrent traces with nested start/end, with the first trace being opened with the Datadog API"""
...
tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability.test_concurrent_traces_nested_otel_root[library_env0, parametric-php] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: assert '14439793382652104568' == '0xc86473938303cf78'
  - 0xc86473938303cf78
  + 14439793382652104568

self = <tests.parametric.test_otel_api_interoperability.Test_Otel_API_Interoperability object at 0x7fc58d9c7200>
test_agent = <utils.docker_fixtures._test_agent.TestAgentAPI object at 0x7fc55b408a70>
test_library = <utils.docker_fixtures._test_clients._test_client_parametric.ParametricTestClientApi object at 0x7fc55b40b590>

    def test_concurrent_traces_nested_otel_root(self, test_agent: TestAgentAPI, test_library: APMLibrary):
        """- Concurrent traces with nested start/end, with the first trace being opened with the OTel API"""
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 224bc53 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@cbeauchesne cbeauchesne force-pushed the cbeauchesne/otel_span_id branch from 8643f18 to 663c4dc Compare March 30, 2026 09:56
@cbeauchesne
Copy link
Copy Markdown
Collaborator Author

s

@cbeauchesne cbeauchesne reopened this Mar 30, 2026
@cbeauchesne cbeauchesne force-pushed the cbeauchesne/otel_span_id branch from 673929a to 0a24ac3 Compare March 30, 2026 10:23
@cbeauchesne cbeauchesne marked this pull request as ready for review March 30, 2026 16:28
@cbeauchesne cbeauchesne requested review from a team as code owners March 30, 2026 16:28
@cbeauchesne cbeauchesne requested review from mcculls and removed request for a team March 30, 2026 16:28
Copy link
Copy Markdown

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

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

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +190 to +191
if isinstance(span_id, str):
assert span_id.startswith("0x")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove strict 0x check until all clients emit new format

This assertion now rejects every string span_id that does not start with 0x, but the PHP parametric server still returns decimal string IDs for /trace/otel/start_span (it sends span_id => $spanId as a string), and PHP OTel tests are active (e.g., tests/parametric/test_otel_span_methods.py::Test_Otel_Span_Methods is enabled in manifests/php.yml). In that environment, _TestOtelSpan construction fails immediately, so many PHP OTel tests regress before reaching their assertions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@mabdinur mabdinur left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR 😄

Co-authored-by: Munir Abdinur <munir_abdinur@hotmail.com>
Copy link
Copy Markdown
Contributor

@mabdinur mabdinur left a comment

Choose a reason for hiding this comment

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

We will need to work through a few of the failing tests but the motivation looks good to me

@cbeauchesne cbeauchesne requested a review from a team as a code owner March 30, 2026 17:03
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