Skip to content

feat: add support for 'random-trace-id' flags in W3C traceparent header trace flags#4854

Open
herin049 wants to merge 6 commits intoopen-telemetry:mainfrom
herin049:feat/random-trace-id-flag
Open

feat: add support for 'random-trace-id' flags in W3C traceparent header trace flags#4854
herin049 wants to merge 6 commits intoopen-telemetry:mainfrom
herin049:feat/random-trace-id-flag

Conversation

@herin049
Copy link
Copy Markdown
Contributor

@herin049 herin049 commented Dec 12, 2025

Description

Adds support for populating the random-trace-id flags in the W3C traceparent header based on the W3C trace context specification: https://www.w3.org/TR/trace-context-2/#random-trace-id-flag

Implements #4826

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit test cases have been updated, and additional tests have been added.

Does This PR Require a Contrib Repo Change?

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Comment thread opentelemetry-sdk/tests/trace/test_trace.py
@herin049 herin049 requested a review from xrmx February 5, 2026 18:13
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread opentelemetry-api/src/opentelemetry/trace/span.py
@herin049 herin049 force-pushed the feat/random-trace-id-flag branch from 8511808 to 703b7fd Compare March 6, 2026 21:28
@aabmass
Copy link
Copy Markdown
Member

aabmass commented Mar 12, 2026

From SIG meeting March 12th:

  • W3C spec needs prototypes so this is helpful
  • Lets bring this to OTel Tues Specification SIG
  • We could merge this as opt-in or as a subclass if we don't want to wait on this PR.
  • We could update the ID generators to still return False so nothing would change for now.
    • The W3C spec has something about downgrading which might make this weird

@herin049
Copy link
Copy Markdown
Contributor Author

bump

@aabmass
Copy link
Copy Markdown
Member

aabmass commented May 7, 2026

@herin049 looks like the test changes are real

@aabmass aabmass moved this from Approved PRs to Approved PRs that need fixes in Python PR digest May 7, 2026
@herin049
Copy link
Copy Markdown
Contributor Author

herin049 commented May 7, 2026

  • feat: update xray trace id generator for 'random-trace-id' flags changes opentelemetry-python-contrib#4030

@aabmass Are you referring to the failing tests in CI? If so, we need to merge this first: open-telemetry/opentelemetry-python-contrib#4030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Approved PRs that need fixes

Development

Successfully merging this pull request may close these issues.

5 participants