About pulsar CPU usage problem
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
**Describe the bug**
The CPU utilization calculated by process_cpu_seconds_total, pulsar_lb_cpu_usage provided by pulsar and container metrics provided by kubernetes are inconsistent and vary greatly, which is the correct one? Why is there a difference?
**Expressions for calculation of indicators**
```
# process_cpu_seconds_totall
irate(process_cpu_seconds_total{pod="pulsar-private-broker-0"}[5m])
# pulsar_lb_cpu_usagel
pulsar_lb_cpu_usage{pod="pulsar-private-broker-0"}
# Container Metrics Metrics provided by kubernetes
sum(irate(container_cpu_usage_seconds_total{pod="pulsar-private-broker-0"}[5m])) by (pod) / sum(kube_pod_container_resource_limits_cpu_cores{pod="pulsar-private-broker-0"}) by (pod)
```
Contributor guide
Research direction
Start by comparing the definitions and units of process_cpu_seconds_total, pulsar_lb_cpu_usage, and container_cpu_usage_seconds_total in the reported PromQL expressions. Determine why their CPU values differ and document which metric answers each utilization question; no source file or test is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kubernetes, prometheus
- Domain
- infrastructure, observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100