Repository navigation
fix(otel): ignore non-string stack frames - #980
Draft
ibrahimmaq14 wants to merge 2 commits into
Draft
ibrahimmaq14 wants to merge 2 commits into
ibrahimmaq14 wants to merge 2 commits into
Conversation
Contributor
|
Looks good to me. @ibrahimmaq14 please mark the PR ready and I'll approve it. |
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.
Issue
Fixes #966.
Description of changes
Filter non-string entries when the shared OTel exception recorder joins checkpointed stack frames. Both the Execution and Invocation views retain valid frames, record the stored error type and message, and finish failed operation and attempt spans.
Design
ErrorObject.from_dictpreserves the stored stack entries. Joining the raw list raisesTypeErrorbefore either plugin can finish the span or detach the attempt context.Assumptions
The regression uses the SDK's real
ErrorObject.from_dictand the real OTel SDK's in-memory exporter. It covers both plugin implementations and checks span completion, context restoration, error status, and exact event attributes. It makes no assumption about whether Lambda produces malformed stacks.Decisions not covered by the issue or the design note
Validation
Python 3.13.17, Hatch 1.16.5, Windows.
hatch run dev-otel:test -q -k malformed_stack --tb=short— 8 failed withTypeErroratb94768f; 8 passed with the fix.hatch run dev-otel:test -q --tb=short— 1,021 passed, 84 warnings.hatch run dev-otel:typecheck— passed, 46 source files checked.hatch fmt --checkfrom the OTel package — Ruff lint and format passed.hatch run test-wheel-otel:test -q --tb=short— 1,021 OTel tests passed and all 12 lifecycle compatibility tests passed.hatch run test-wheel-otel-legacy:test -q --tb=short— 4 passed.mainworktree at764e950bran the full suite with 6,998 passed, 5 failed, and 7 skipped. Negative timestamps and port binding failed on both revisions. Callback suites showed intermittent Windows checkpoint-file access errors and replay-count differences on the baseline and patch across the full and focused runs. All six empty-callback persistence cases passed when rerun in isolation on both revisions.Checklist
Prepared with OpenAI Codex assistance. The results above are from local runs.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.