Skip to content

Commit

Permalink
add thread name
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Jan 17, 2024
1 parent 87a33e6 commit 3cf6f6a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions profiling/src/profiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,15 @@ impl Profiler {
value: LabelValue::Num(unsafe { libc::pthread_self() as i64 }, "id".into()),
});

let thread_name = match std::thread::current().name() {
Some(name) => name,
None => "",
};
labels.push(Label {
key: "thread name",
value: LabelValue::Str(thread_name.into()),
});

let tags = TAGS.with(|cell| Arc::clone(&cell.borrow()));

SampleMessage {
Expand Down

0 comments on commit 3cf6f6a

Please sign in to comment.