fix(otel): relax semantic-conventions upper bound - #605
Merged
Conversation
The `<0.61` cap pinned the whole OpenTelemetry stack for downstream
consumers, not just semconv. OTel ships semconv and the instrumentation
packages as a lockstep set pinned with `==`, and semconv itself requires
an exact opentelemetry-api version, so the ceiling held consumers' api
and sdk at the 1.39.x generation.
Replace the ceiling with a floor on semantic-conventions and
instrumentation-httpx. All 39 semconv symbols the SDK references resolve
to identical values in 0.60b1 and 0.65b0, so no span attribute names
change.
Lifting the cap surfaced a latent bug. W3C trace-context level 2 adds the
random-trace-id flag (0x02), so a sampled span serializes as "-03" from
opentelemetry-api 1.44.0. TraceparentInjectionHook compared the flags byte
with `endswith("-01")`, read that as unsampled, and discarded the
propagated context, starting a new trace on every workflow /execute call.
Test the sampled bit as a bitmask instead.
Verified on semconv 0.60b1 / api 1.39.1 and semconv 0.65b0 / api 1.44.0.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
verdie-g
force-pushed
the
relax-otel-semconv-upper-bound
branch
from
August 10, 2026 14:06
821b686 to
70f3677
Compare
3 tasks
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.
Why
opentelemetry-semantic-conventions (>=0.60b1,<0.61)capped the whole OpenTelemetry stack for downstream consumers, not just semconv.OTel ships semconv and the
instrumentation-*packages as a lockstep set pinned with==, and semconv itself requires an exact api version:So
<0.61held consumers'opentelemetry-apiand-sdkat the 1.39.x generation. A floor keeps the caution without letting a library dictate the application's whole observability stack.Changes
pyproject.tomlsemantic-conventionsandinstrumentation-httpx_hooks/traceparent.pytests/test_traceparent_hook.pyThe bug the cap was hiding
W3C trace-context level 2 adds
RANDOM_TRACE_ID = 0x02, so fromopentelemetry-api1.44.0 a sampled span serializes as-03, not-01:Every workflow
/executecall would silently start a new trace, orphaning worker traces from their caller. Latent today only because the cap kept api at 1.39.1, so relaxing the cap without this fix would ship the regression.Verification
extrasuite: 260 passed on semconv 0.60b1 / api 1.39.1 and on 0.65b0 / api 1.44.0, so the floor stays genuinely supported rather than just the ceiling raised.ruffandmypyclean.Note on generated code
pyproject.tomlis listed in.genignore, and none of the three files appear ingen.lock's tracked manifest, so nogen.yamlchange is needed. I could not completespeakeasy runlocally — it aborts during source validation, identically on a pristine tree — so that is worth confirming on a CI generation run.