feat(crashtracking): capture unhandled exception with the crashtracker #5321
feat(crashtracking): capture unhandled exception with the crashtracker #5321
Conversation
|
Thank you for updating Change log entry section 👏 Visited at: 2026-02-10 01:22:21 UTC |
c5d3fce to
e4b1623
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: ba2fa9e | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksBenchmark execution time: 2026-02-10 14:30:49 Comparing candidate commit ba2fa9e in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics. |
6f5fc9b to
25077d0
Compare
p-datadog
left a comment
There was a problem hiding this comment.
I read the C code and while nothing jumped out at me I also don't know if everything there is correct.
I left comments for the Ruby code.
In general, since we do have a crash tracker for crashes, I would like to see "unhandled exceptions" (and more precisely, "unhandled exceptions on main thread") NOT be referred to as "crashes" in Ruby code or documentation. I understand that eventually the libdatadog data structures will be created that have "crash" in their name, but I would prefer to see everything upstream of that use correct terminology and refer to "unhandled exceptions".
87fad47 to
808b3f6
Compare
+1 on this -- I suggest updating the PR title and changelog entry as well. |
Typing analysisNote: Ignored files are excluded from the next sections. Untyped methodsThis PR introduces 1 partially typed method, and clears 1 partially typed method. It increases the percentage of typed methods from 59.87% to 59.96% (+0.09%). Partially typed methods (+1-1)❌ Introduced:Untyped other declarationsThis PR introduces 1 untyped other declaration, and clears 1 untyped other declaration. Untyped other declarations (+1-1)❌ Introduced:If you believe a method or an attribute is rightfully untyped or partially typed, you can add |
ea94407 to
3fabed1
Compare
Signal based crash report (crash done, need to do ping) Revert "Gitignore weird files that keep popping up (will pop this commit later)" This reverts commit aeb3017. Revert "Remove VS Code config files from tracking" This reverts commit 2b30b86. Use locations array Clean Lazy logging Fix memory leak
Fmt fmt Do work on ruby side, fix sus calls Remove noisy log Update symbol name Check result, build message in ruby unit test and test cleanup Inline + no order dependency + cleanup Number of frames logic on ruby side frame processing in helper Restore accidentally deleted comment Update tags on fork Fmt Fix potential mem leak move to core clean Extract into helper Fix more potential leaks Fmt Remove comment from Ruby exception crash reporting context Removed comment about Ruby exception crash reporting tests. Respond to oleg -(rescuing all exceptions) Flip negation No more do-while, crash vs exception naming, test sleep fix, minor refactoring Tag builder helper func, move all logic into ct component, move builder into build function
Trigger CI rbs file Trigger CI CI debug We need to explicitly check, not depend on order Be explicit with typing Trigger CI Incomplete stack Clarity in tests
9050813 to
c0aec88
Compare
ivoanjo
left a comment
There was a problem hiding this comment.
👍 LGTM, I like this latest iteration!
| @@ -0,0 +1,205 @@ | |||
| #include <datadog/common.h> | |||
There was a problem hiding this comment.
I know that it's crashing, but we could have call ddog_Error_drop on the error. (cleaner)
There was a problem hiding this comment.
Uh, right, we are definitely leaking the error, if it ever gets triggered -- very worth cleaning it up. Can you look into it @gyuheon0h ?
(Again, this API is sooooooooo awkward and I'm looking forward to actually having libdatadog handle things in a much nicer way instead of dropping all this complexity on the Ruby side)
What does this PR do?
This PR adds support for crash report collection and emission for ruby unhandled exceptions. We do this by hooking into
at_exitand accessing the exception stack. We send the exception stack over from the Ruby side to the native code side, and use it to build a crash report. We also send a crash ping, mainly for parity.Native stack collection planned to be implemented but is out of scope for this stage.
Motivation:
Nice to see non-signal based crashes (not captured by regular errortracking) and was a feature request from SSI team.
Ticket: PROF-13673
Change log entry
Yes. Crashtracking: unhandled exceptions are caught and reported by the crashtracker
Additional Notes:
How to test the change?
Unit tests
Run a test ruby program instrumented with the crashtracker and look at the report being sent.