fix: #260 sanitize oversized tracing span payloads#2549
Merged
Conversation
This was referenced Feb 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.
This pull request resolves #260 by sanitizing oversized
span_data.inputandspan_data.outputfields before the SDK posts spans to the default OpenAI traces ingest endpoint. Large string fields are truncated to stay within the ingest byte limit, while oversized structured payloads are reduced without breaking the expected OpenAI trace shape, so generation spans with nested inputs such as base64 audio blobs still ingest successfully.The change is intentionally scoped to the built-in OpenAI tracing exporter and does not change custom endpoint behavior or the public tracing API. It also keeps the existing generation usage sanitization, preserves efficient string truncation, and safely handles values that are not JSON-serializable.
This pull request also expands
tests/test_trace_processor.pywith regression coverage for oversized string payloads, oversized structured generation payloads, custom-endpoint passthrough, escape-heavy strings, and unserializable values.