This topic describes monitoring metrics related to the number of OCP-Agent process goroutines on a host.
Details
Item |
Description |
|---|---|
| OCP display name | Number of OCP-Agent process goroutines |
| Source metric | go_goroutines (Prometheus standard metric) |
| OCP metric | monagent_goroutine_count / mgragent_goroutine_count |
| Collection method | Does not use processInput: prometheusInput directly fetches data from the agent's HTTP endpoint. |
| Endpoint | `http://127.0.0.1:${ocp.agent.monitor.http.port}/metrics/stat`` |
| Data source | Go runtime metrics exposed by prometheus.NewGoCollector() in the agent. |
| Meaning | The number of goroutines (Go goroutines, not OS threads) in the ocp_monagent or ocp_mgragent process. |
| Collection cycle | Approximately 60 seconds (slower than the previous four metrics). |
| Scope of application | Applicable only to agent processes written in Go. Observer/obproxy does not have this metric. |
Difference from "Number of Process Threads"
Dimension |
Number of Process Threads |
Number of Goroutines |
|---|---|---|
| Object | OS thread (kernel-scheduled) | Go goroutine (user-space) |
| Data source | /proc/pid/status |
Go runtime runtime.NumGoroutine() |
| Applicable processes | observer, obproxy, agent, etc. | Only ocp_monagent, ocp_mgragent |
monagent
Description
Metric |
Metric name |
Unit |
|---|---|---|
| monagent | monagent_goroutine_count | N/A |
Calculation expression
max(go_goroutines{process="ocp_monagent",@LABELS}) by (@GBLABELS)
Verification command
# On the Agent host (the port number is subject to the actual configuration.)
curl -s http://127.0.0.1:<monitor_port>/metrics/stat | grep go_goroutines
# or via unix socket
curl -s --unix-socket $OCP_AGENT_HOME/run/ocp_monagent.*.sock \
http://unix-socket-server/metrics/stat | grep go_goroutines
mgragent
Description
Metric |
Metric name |
Unit |
|---|---|---|
| mgragent | mgragent_goroutine_count | N/A |
Calculation expression
max(go_goroutines{process="ocp_mgragent",@LABELS}) by (@GBLABELS)
Customer scenario reading suggestions
Metric |
Reading method |
|---|---|
| Goroutines | Used only to troubleshoot whether the agent has goroutine leaks and is not directly related to high OBServer CPU usage. |
