-
Notifications
You must be signed in to change notification settings - Fork 16
feat(crashtracking)!: emit crashing thread name in crash report for linux crashes #1485
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
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 966d4f9 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
29b2a99 to
4102352
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1485 +/- ##
========================================
Coverage 70.96% 70.97%
========================================
Files 421 421
Lines 68438 68580 +142
========================================
+ Hits 48567 48674 +107
- Misses 19871 19906 +35
🚀 New features to boost your workflow:
|
BenchmarksComparisonBenchmark execution time: 2026-01-28 19:52:00 Comparing candidate commit 966d4f9 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 2 unstable metrics. CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
Group 12
Group 13
Group 14
Group 15
Group 16
Group 17
Group 18
Group 19
BaselineOmitted due to size. |
4102352 to
d1e1f39
Compare
9ca25d2 to
966d4f9
Compare
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-apple-darwin
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-apple-darwin
x86_64-unknown-linux-gnu
|
gleocadie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR.
I have questions and we should also think about the message/log sent to the errors intake.
We may want to have same level of information here too.
| #[cfg(target_os = "linux")] | ||
| emit_thread_name(pipe, ppid, crashing_tid)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not letting the receiver gathering the thread name ? It might be simpler relying on the receiver no ?
We could imagine passing on the command line of the receiver the thread id of the crashing thread.
There is phase enrich_callstacks where the receiver enriches the frames with build id. We could have a enrich_thread which will be able to collect the thread name
| let mut buf = Vec::new(); | ||
|
|
||
| emit_thread_name(&mut buf, pid, tid).expect("thread name to emit"); | ||
| let out = str::from_utf8(&buf).expect("to be valid UTF8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename out to thread_name please
| #[cfg(not(any(target_os = "linux", target_os = "macos")))] | ||
| fn current_tid() -> libc::pid_t { | ||
| 0 | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it needed ?

What does this PR do?
~600 lines out of the 840 diff is from JSON schema update
This PR adds support to include the name of the crashing thread in the crash report. We cannot use
prctlor otherPthreadAPI in the collector, because those functionalities are not signal safe. However, we can send theproc/[pid]/task/[tid]to the receiver and do parsing there to retrieve the thread name.We add a
thread_namefield as an optional field to theErrorDataobject and update the schema and payload format RFC respectivelyWe also add an FFI api that allows consumers to set
thread_name.Motivation
It would be nice to know the name of the crashing thread in order to aid with debugging crashes.
Additional details
This PR only implements for Linux; MacOS is not supported yet.
How to test the change?
Run a crash and check the payload. Can also run
test_crash_tracking_thread_name.BREAKING CHANGE: