-
Notifications
You must be signed in to change notification settings - Fork 489
feat(crashtracking): hook based exception profiling for versions 3.12+ #16567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 9 commits into
main
from
gyuheon0h/exception-prof-hook
Mar 17, 2026
+1,178
−90
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9917e2a
Hook based 3.12+
gyuheon0h b7fbd78
Document traceback direction, set default to false
gyuheon0h ac996eb
Make sampler into a class, enhance tests, cleanups, from TK review
gyuheon0h 732f2ca
Lazily extract frame info
gyuheon0h 0cc56ae
Reentrancy guard, leaking exception guard, register order clean up
gyuheon0h 5d91f47
Upfront allocation and fix reentrancy guard
gyuheon0h 17a37b1
Clean up sample pushing, add validator to setting, clean log level
gyuheon0h ec8d304
Use tool id 4
gyuheon0h 97e337d
Changelog
gyuheon0h File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from types import CodeType | ||
| from typing import Optional | ||
|
|
||
| from ddtrace.profiling import collector | ||
|
|
||
| HAS_MONITORING: bool | ||
| MAX_EXCEPTION_MESSAGE_LEN: int | ||
|
|
||
| class ExceptionCollector(collector.Collector): | ||
| _sampling_interval: int | ||
| _collect_message: bool | ||
| _monitoring_registered: bool | ||
| def __init__( | ||
| self, | ||
| sampling_interval: Optional[int] = None, | ||
| collect_message: Optional[bool] = None, | ||
| ) -> None: ... | ||
| def _start_service(self) -> None: ... | ||
| def _stop_service(self) -> None: ... | ||
|
|
||
| def _on_exception_handled(code: CodeType, instruction_offset: int, exception: BaseException) -> None: ... |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.