Repository navigation
opentelemetry-api: refine traceparent parsing - #5818
Merged
Merged
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-26 09:22 UTC Status above doesn't look right?
|
aabmass
approved these changes
Oct 23, 2026
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped, include targeted regression coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR hardens trace-context extraction in opentelemetry-api by limiting traceparent headers to 512 characters and refining suffix and whitespace matching.
Changes:
- Reject oversized headers with a warning before parsing.
- Adjust the parsing expression while preserving accepted inputs within the limit.
- Add length-boundary and whitespace/suffix regression tests, plus a changelog entry.
| File | Description |
|---|---|
opentelemetry-api/tests/trace/propagation/test_tracecontexthttptextformat.py |
Adds boundary and parsing regression tests. |
opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py |
Enforces the length limit and refines matching. |
.changelog/5818.fixed |
Documents the extraction limit. |
Review effort: Balanced
xrmx
approved these changes
Oct 26, 2026
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.
Description
Refines traceparent parsing to accept reasonable input sizes.
Type of change
Please delete options that are not relevant.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheck