You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
Feature Request: Metric to expose {{.HostConfig.NanoCpus}} inspect property
The existing CPU panel in the example Grafana dashboard seems to compare container CPU usage to the full CPU capacity of the server, but my specific use-case is that I'm trying to calculate the percent CPU usage of the available capacity ({{.HostConfig.NanoCpus}} from inspect, vs the host system CPU count).
The workaround I'm using just has the CPU count for a service's containers, but that's error-prone, and it throws off old data if I change the deployment.
Here's the query that I'm using currently. Please say if I'm misunderstanding something, but with the correct variables, it seems to accurately reflect CPU usage.
increase(docker_container_cpu_used_total{exported_name =~ "myapp[0-9]+"}[5m])
/ increase(docker_container_cpu_capacity_total[5m])
/ $myapp_cpus
* 100
* on (name) group_left count(netdata_cpu_cpu_percentage_average{job="myapp-netdata", dimension="user"}) by (name)
Having the host machine's CPU count would be a nice-to-have, but I'm currently getting that from Netdata and rolling it in, and I imagine that's pretty far outside the scope of what your existing code does.
I appreciate the exporter, I've found it very useful! Thanks!
The text was updated successfully, but these errors were encountered:
dechandler
changed the title
Expose host and container CPU counts
Expose CPU Limit
Jun 17, 2020
Feature Request: Metric to expose
{{.HostConfig.NanoCpus}}
inspect propertyThe existing CPU panel in the example Grafana dashboard seems to compare container CPU usage to the full CPU capacity of the server, but my specific use-case is that I'm trying to calculate the percent CPU usage of the available capacity (
{{.HostConfig.NanoCpus}}
from inspect, vs the host system CPU count).The workaround I'm using just has the CPU count for a service's containers, but that's error-prone, and it throws off old data if I change the deployment.
Here's the query that I'm using currently. Please say if I'm misunderstanding something, but with the correct variables, it seems to accurately reflect CPU usage.
Having the host machine's CPU count would be a nice-to-have, but I'm currently getting that from Netdata and rolling it in, and I imagine that's pretty far outside the scope of what your existing code does.
I appreciate the exporter, I've found it very useful! Thanks!
The text was updated successfully, but these errors were encountered: