This topic describes monitoring metrics related to the number of process threads on a host.
Details
Item |
Description |
|---|---|
| OCP Display Name | Number of Process Threads |
| Raw Metric | process_thread_count |
| Collection API | proc.NumThreads() |
| Linux Data Source | The Threads field in /proc/<pid>/status |
| Meaning | The total number of currently alive threads in the process (including OB worker threads, network threads, etc.) |
| OCP Aggregation | avg(process_thread_count{name="observer"}) |
| Characteristics | Instantaneous value; the number of OBServer threads varies with load, which can help assess concurrency pressure. |
Handling Multiple Processes with the Same Name
When multiple processes have the same name, the maximum value (math.Max()) is returned.
observer
Description
Metric |
Metric name |
Unit |
|---|---|---|
| observer | observer_thread_count | N/A |
Calculation expression
avg(process_thread_count{name="observer",@LABELS}) by (@GBLABELS)
Verification command
PID=$(pidof observer)
grep Threads /proc/$PID/status
# Output example: Threads: 512
ps -o pid,nlwp,comm -p $PID # nlwp = number of light-weight processes (threads)
obproxy
Description
Metric |
Metric name |
Unit |
|---|---|---|
| obproxy | obproxy_thread_count | N/A |
Calculation expression
avg(process_thread_count{name="obproxy",@LABELS}) by (@GBLABELS)
monagent
Description
Metric |
Metric name |
Unit |
|---|---|---|
| monagent | monagent_thread_count | N/A |
Calculation expression
avg(process_thread_count{name="ocp_monagent",@LABELS}) by (@GBLABELS)
mgragent
Description
Metric |
Metric name |
Unit |
|---|---|---|
| mgragent | mgragent_thread_count | N/A |
Calculation expression
avg(process_thread_count{name="ocp_mgragent",@LABELS}) by (@GBLABELS)
Client scenario reading suggestions
Metric |
Reading method |
|---|---|
| Threads | A sudden increase often coincides with increased concurrency or internal tasks. |
