fix: baggage extract preserves context; OTLP endpoint scheme determines TLS#89
Merged
Merged
Conversation
Fixes #87: W3CBaggagePropagator.extract returned a fresh context when the baggage header was absent, discarding the span context the tracecontext stage of the spec-default composite had just extracted — breaking traces at every service boundary for baggage-less requests. Extract now returns the passed context unchanged, per the Propagators API spec. Fixes #88: OTLP endpoint schemes now determine connection security per the OTLP spec: http:// is insecure, https:// secure, and OTEL_EXPORTER_OTLP_INSECURE (+ per-signal variants) applies only to scheme-less endpoints; explicit programmatic secure still wins. Shared across all three signals via OTelEnv.resolveOtlpSecure; metrics now honor OTEL_EXPORTER_OTLP_METRICS_INSECURE (was parsed, ignored). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #87, fixes #88 — the two SDK bugs surfaced by the reference-demo review.
#87 — baggage extract clobber
W3CBaggagePropagator.extractreturnedOTel.context()when thebaggageheader was absent, so the spec-default composite (tracecontext → baggage) threw away the span context it had just extracted for any request without baggage — most requests from most clients. Now returns the passed context unchanged (Propagators API spec). The reference demo's hand-ordered extraction workaround can be retired after this ships.#88 — scheme-determined TLS
Per the OTLP exporter spec, the endpoint scheme indicates connection security, and
OTEL_EXPORTER_OTLP_INSECURE"only applies … without the http or https scheme." New sharedOTelEnv.resolveOtlpSecureimplements the precedence (explicitsecure> scheme > env insecure > secure default) across traces, metrics, and logs. Barehost:portendpoints are guarded againstUri's bogus-scheme parsing. Bonus parity fix: metrics now honorOTEL_EXPORTER_OTLP_METRICS_INSECURE, which was parsed and dropped.Behavior change (documented in CHANGELOG):
http://endpoints now connect insecure without needing the extra flag — the footgun every consumer worked around.https://and scheme-less endpoints behave as before.Tests
resolveOtlpSecure: full precedence matrix incl. env-vs-scheme conflicts and thecollector:4317bogus-scheme guard; in-process pipeline check that anhttp://env endpoint initializes without the insecure flag../tool/test.sh.🤖 Generated with Claude Code