Repository navigation
fix(core): send OTLP/protobuf to Arize AX so trace and span ids survive - #178
Open
zaccromero wants to merge 1 commit into
Open
zaccromero wants to merge 1 commit into
zaccromero wants to merge 1 commit into
Conversation
The Arize AX exporter posted OTLP/JSON with hex-encoded traceId/spanId, as the OTLP/JSON spec requires. Arize's OTLP/HTTP JSON intake decodes those fields as base64 (the generic protobuf-JSON bytes mapping) instead, so every id was stored corrupted: a 32-hex trace id arrives as 48 hex chars and a 16-hex span id as 24. Trees from one harness still looked right, because every id in a payload was corrupted the same way. But a span could never join a trace started by any other OpenTelemetry producer, and ids in Arize never match the ids the harness generated. Send the payload through the existing otlp_json_to_protobuf encoder (already used for Phoenix) with Content-Type application/x-protobuf. The encoder hex-decodes ids into raw bytes, so Arize stores exactly what was generated. Still stdlib-only. Also correct the skill guides that described the transport as HTTP/JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zaccromero
requested review from
21ShisodeParth,
caroger,
fjcasti1,
gabe0912,
jyadav2008,
kafedewa,
musicionary,
nate-mar,
sanchitram1 and
tofuadmiral
as code owners
October 29, 2026 05:25
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
zaccromero
requested review from
a team,
chrisgong52 and
nosnaws
as code owners
October 29, 2026 05:25
This branch has not been deployed
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.
Summary
The Arize AX exporter posts OTLP/JSON with hex-encoded
traceId/spanId, as the OTLP/JSON spec requires. Arize's OTLP/HTTP JSON intake decodes those two fields as base64 instead (the generic protobuf-JSON mapping forbytes), so every id is stored corrupted: a 32-hex trace id arrives as 48 hex characters and a 16-hex span id as 24.Trees from a single harness still look correct, because every id in a payload is corrupted the same way. The damage shows up when anything else needs the ids:
Reproduction: export a span with
traceId=0123456789abcdef0123456789abcdef. Before this change the trace is not found under that id; it is found underbase64decode("0123456789abcdef0123456789abcdef").hex(), a 48-hex value. After this change it is stored under exactly0123456789abcdef0123456789abcdef, with its parent span id intact.This PR sends the Arize payload through the existing
otlp_json_to_protobufencoder (already used for Phoenix) withContent-Type: application/x-protobuf. The encoder hex-decodes ids into raw bytes, so Arize stores exactly what was generated. It stays stdlib-only. The skill guides that described the transport as HTTP/JSON are corrected; their point (no Python dependencies needed) still holds.Phoenix is unaffected: it was already sent as protobuf.
Type of change
How tested
tests/core/test_common.py::TestSendSpan::test_arize_direct_sendnow assertsapplication/x-protobuf, that the body equals the encoder's output for the injected payload, and that the raw trace and span id bytes are on the wire. The existing assertions onarize.project.name/arize.project.typeplacement are kept, run against the encoded payload.ax spans export --trace-id <that exact 32-hex id>, with its root span parented to the expected span id. Before the change the same lookup returned nothing and the spans were present only under the base64-misdecoded id.uv run pytest tests/ -m "not slow"on this branch: 2767 passed, 4 skipped, 8 deselected, 1 xfailed.uv run pre-commit run --all-files: all hooks pass (isort, black, ruff, mypy for core and every harness).Checklist
uv run pytest tests/ -m "not slow")uv run pre-commit run --all-files)code-reviewskill and addressed findingsRelated: #170 touches the transcript parser and is independent of this change.
🤖 Generated with Claude Code