Skip to content

Add metric showing CPU limits on containers #465

@InfoSec812

Description

@InfoSec812

Is your feature request related to a problem? Please describe.
Re-submitting #363

Add a metric which shows the CPU limits on each container/pod so that when computing CPU usage over time it is possible to show a percentage based on allocated CPUs

Describe the solution you'd like

Something like:

# HELP podman_container_cpu_limit The number of CPUs allocated to the container
# TYPE podman_container_cpu_limit guage
podman_container_cpu_limit{id="093c10960cca",pod_id="",pod_name=""} 3

Additional context
Using this in conjunction with podman_container_cpu_seconds_total would allow for showing what percentage of the allocated CPUs are being used. For example, a query like this would be able to show CPU usage as a percentage of allocated CPUs:

(rate(podman_container_cpu_seconds_total[5m])/podman_container_cpu_limit)+ on(id) group_left(name) (0 * podman_container_info)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions