Strip only the leading uberctx- prefix from a Jaeger baggage key - #5557
Open
serhiy-bzhezytskyy wants to merge 3 commits into
Open
Strip only the leading uberctx- prefix from a Jaeger baggage key#5557serhiy-bzhezytskyy wants to merge 3 commits into
serhiy-bzhezytskyy wants to merge 3 commits into
Conversation
serhiy-bzhezytskyy
added a commit
to serhiy-bzhezytskyy/opentelemetry-python
that referenced
this pull request
Aug 19, 2026
Assisted-By: Claude Fable 5
Pull request dashboard statusWaiting on maintainers · refreshed 2026-08-28 12:08 UTC Resolve merge conflicts, then merge when ready. Status above doesn't look right?
|
ocelotl
reviewed
Aug 26, 2026
| continue | ||
| context = baggage.set_baggage( | ||
| key.replace(self.BAGGAGE_PREFIX, ""), | ||
| key[len(self.BAGGAGE_PREFIX) :], |
Contributor
There was a problem hiding this comment.
str.removeprefix is available in >=3.10 key.removeprefix(self.BAGGAGE_PREFIX) matches better with the PR title
Contributor
Author
There was a problem hiding this comment.
Thanks, done.
`key.replace(self.BAGGAGE_PREFIX, "")` removes every occurrence, so a carrier key that repeats the prefix loses the inner literal: `uberctx-a-uberctx-b` became the baggage key `a-b` instead of `a-uberctx-b`. Slice off the prefix instead. The class needs pylint's max-public-methods relaxed for the added test, the same way `propagator/opentelemetry-propagator-b3/tests/test_b3_format.py` does. Assisted-By: Claude Fable 5
Assisted-By: Claude Fable 5
removeprefix reads as what the code does; the package requires Python >=3.10, well past 3.9 where it was added.
serhiy-bzhezytskyy
force-pushed
the
fix/jaeger-baggage-key-prefix
branch
from
August 27, 2026 06:58
000751f to
bc91c06
Compare
xrmx
approved these changes
Aug 28, 2026
Contributor
|
Although correct, I wonder how valid/common this is :) |
carlosalberto
approved these changes
Aug 28, 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.
JaegerPropagator._extract_baggagebuilds the baggage key withkey.replace(self.BAGGAGE_PREFIX, ""), whichremoves every occurrence of
uberctx-rather than the leading one. A carrier key that repeats the prefix loses theinner literal:
uberctx-a-uberctx-bextracts as the baggage keya-binstead ofa-uberctx-b. Slicing the prefixoff fixes it.
Adds one test that fails on
mainwitha-b. The test class needs pylint'smax-public-methodsrelaxed for theadded method, the same way
propagator/opentelemetry-propagator-b3/tests/test_b3_format.pydoes.This touches the same method as #5556, two lines from the byte accounting there, so whichever merges second needs a
trivial rebase.
Assisted-By: Claude Fable 5