Skip to content

fix: #260 sanitize oversized tracing span payloads#2549

Merged
seratch merged 1 commit intomainfrom
fix/trace-ingest-payload-truncation
Feb 26, 2026
Merged

fix: #260 sanitize oversized tracing span payloads#2549
seratch merged 1 commit intomainfrom
fix/trace-ingest-payload-truncation

Conversation

@seratch
Copy link
Member

@seratch seratch commented Feb 26, 2026

This pull request resolves #260 by sanitizing oversized span_data.input and span_data.output fields 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.py with regression coverage for oversized string payloads, oversized structured generation payloads, custom-endpoint passthrough, escape-heavy strings, and unserializable values.

@seratch seratch added this to the 0.10.x milestone Feb 26, 2026
@github-actions github-actions bot added bug Something isn't working feature:tracing labels Feb 26, 2026
@seratch seratch merged commit b7cdd78 into main Feb 26, 2026
9 checks passed
@seratch seratch deleted the fix/trace-ingest-payload-truncation branch February 26, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Truncate span input when input is too large

1 participant