Skip to content

Commit d8ba453

Browse files
feat: Add thread pool info context to Contexts (#14931)
1 parent cc718df commit d8ba453

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

develop-docs/sdk/data-model/event-payloads/contexts.mdx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,54 @@ The following example illustrates the contexts part of the <Link to="/sdk/data-m
622622
}
623623
```
624624

625+
## Thread Pool Info Context
626+
627+
The thread pool info context captures detailed metrics about the thread pool state at the moment an event occurs. This context is useful for investigating performance bottlenecks, thread starvation, and resource contention issues in multi-threaded applications.
628+
629+
The `type` and default key is `"threadpool_info"`.
630+
631+
`available_worker_threads`
632+
633+
: Number of worker threads currently available in the thread pool. Worker threads are used for executing application code and handling CPU-bound tasks.
634+
635+
`available_completion_port_threads`
636+
637+
: Number of completion port threads (also known as I/O completion port threads) currently available. These threads handle I/O operations and asynchronous callbacks.
638+
639+
`max_worker_threads`
640+
641+
: Maximum number of worker threads the thread pool can have. This represents the upper limit for worker thread allocation.
642+
643+
`max_completion_port_threads`
644+
645+
: Maximum number of completion port threads the thread pool can maintain. This sets the ceiling for I/O completion port thread allocation.
646+
647+
`min_worker_threads`
648+
649+
: Minimum number of worker threads maintained by the thread pool. The thread pool will always keep at least this many worker threads active.
650+
651+
`min_completion_port_threads`
652+
653+
: Minimum number of completion port threads maintained by the thread pool. This ensures a baseline number of threads are available for I/O operations.
654+
655+
**Example Thread Pool Info Context**
656+
657+
```json
658+
{
659+
"contexts": {
660+
"threadpool_info": {
661+
"available_worker_threads": 1022,
662+
"available_completion_port_threads": 1000,
663+
"max_worker_threads": 1023,
664+
"max_completion_port_threads": 1000,
665+
"min_worker_threads": 1,
666+
"min_completion_port_threads": 1
667+
}
668+
}
669+
}
670+
```
671+
672+
625673
## Trace Context
626674

627675
Additional information that allows Sentry to connect multiple transactions, spans, and/or errors into one trace. **Important:** If the trace context is missing, relay will drop the transaction.

0 commit comments

Comments
 (0)