Skip to content

Fail closed on span customizer errors without dropping spans - #915

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
ark/SDK-472-customizer-error-handling
Oct 13, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
ark/SDK-472-customizer-error-handling

Conversation

@realark

@realark Andrew Kent (realark) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

AI Summary

Implements only the span customizer hook-failure contract (SDK-472).

  • Stop the hook chain on invalid results or any BaseException except KeyboardInterrupt/SystemExit; export original identity/routing/protocol fields and original start/end timestamps plus context={"customizer_error": true}, never the original payload or earlier mutations.
  • Keep stripped records memoized across lazy-resolution and transport retries. Do not invent missing timestamps; later incremental records are independent. Preserve successful customization and dict-subclass conversion.
  • Log at most one private-data-free hook-failure error per process, including concurrent failures and registration changes.
  • Prevent failed-record attachment uploads and exempt SDK-marked stripped records from masking. Stripped records are merge/request barriers, so neighboring incremental content cannot contaminate cached failures. Send barrier batches in order to preserve the existing duplicate-row transaction protocol; successful-only batching is unchanged.
  • Update public API documentation and replace dropped-record tests with stripping coverage.

Verification

  • cd py && mise exec -- uv run nox -s test_core: 987 passed, 73 skipped, 12 xfailed (Python 3.12.12).
  • Core suite includes a real localhost HTTP smoke through the SDK HTTP connection and background exporter: success/failure/success on one span, HTTP 503 retry with identical stripped bytes, arbitrary masking, untouched cached failure, failed attachment suppression, and healthy attachment upload.
  • Regression coverage includes invalid returns/coroutines, dict subclasses, BaseException/GeneratorExit/CancelledError, process-control propagation, original mutated identity/timing, full content stripping, no-duration incremental updates, ordering, mixed batches, retry caching, local experiment cache, concurrent once-only diagnostics, privacy, and disabled error logging.
  • Ruff formatting/checks on the four changed files passed. Commit hooks passed: EOF, whitespace, Ruff format/check, codespell.

Limitations

  • Native Python export path only; OTel customizer support remains intentionally unchanged.
  • No remote Braintrust service or optional-provider integration matrix was exercised; HTTP smoke uses a local server and attachment upload behavior is observed with spies.
  • Only Python 3.12.12 was exercised locally; CI covers the remaining supported Python versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realark
Andrew Kent (realark) force-pushed the ark/SDK-472-customizer-error-handling branch from 48c17d9 to e430ff3 Compare October 13, 2026 02:08
@realark
Andrew Kent (realark) marked this pull request as ready for review October 13, 2026 02:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T02:18:20.186134Z e430ff3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 27c18e1 into main Oct 13, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the ark/SDK-472-customizer-error-handling branch October 13, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants