Thread
Thread Attributes
These attributes may be used for any operation to store information about a thread that started a span.
Attributes:
| Key | Stability | Value Type | Description | Example Values |
|---|---|---|---|---|
thread.id | int | Current “managed” thread ID (as opposed to OS thread ID). [1] | 42 | |
thread.name | string | Current thread name. [2] | main |
[1] thread.id: Examples of where the value can be extracted from:
| Language or platform | Source |
|---|---|
| JVM | Thread.currentThread().threadId() |
| .NET | Thread.CurrentThread.ManagedThreadId |
| Python | threading.current_thread().ident |
| Ruby | Thread.current.object_id |
| C++ | std::this_thread::get_id() |
| Erlang | erlang:self() |
[2] thread.name: Examples of where the value can be extracted from:
| Language or platform | Source |
|---|---|
| JVM | Thread.currentThread().getName() |
| .NET | Thread.CurrentThread.Name |
| Python | threading.current_thread().name |
| Ruby | Thread.current.name |
| Erlang | erlang:process_info(self(), registered_name) |
Feedback
Was this page helpful?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!