Skip to content

How to treat ecs_cpu_seconds_total #34

@jseiser

Description

@jseiser

I can not find a way to graph ecs_cpu_seconds_total like I can for any other exporter we have that is returning CPU seconds.

  1. https://www.robustperception.io/understanding-machine-cpu-usage/
  2. https://stackoverflow.com/questions/34923788/prometheus-convert-cpu-user-seconds-to-cpu-usage/34930574#34930574

Anything im trying, is returning very large numbers that I do not understand.

When i check the /metrics in my browser I get

ecs_cpu_seconds_total{container="heartbeat",cpu="0"} 2.3798033553e+08
ecs_cpu_seconds_total{container="heartbeat",cpu="1"} 2.37868708e+08
ecs_cpu_seconds_total{container="log_router",cpu="0"} 9.787324061e+07
ecs_cpu_seconds_total{container="log_router",cpu="1"} 9.13804651e+07
ecs_cpu_seconds_total{container="prom_exporter",cpu="0"} 3.971903977e+07
ecs_cpu_seconds_total{container="prom_exporter",cpu="1"} 4.042450038e+07

When i query in prom

ecs_cpu_seconds_total{container="heartbeat", cpu="0", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 247372377.12
ecs_cpu_seconds_total{container="heartbeat", cpu="1", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 247288853.64
ecs_cpu_seconds_total{container="log_router", cpu="0", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 101809511.73
ecs_cpu_seconds_total{container="log_router", cpu="1", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 94857416.9
ecs_cpu_seconds_total{container="prom_exporter", cpu="0", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 42798612.53
ecs_cpu_seconds_total{container="prom_exporter", cpu="1", ecs_cluster="Cluster01", ecs_task_id="5ccd12509b6545519a62604d624f44d0", ecs_task_version="10", instance="10.1.111.137:9779", job="Heartbeat", metrics_path="1m/metrics"} | 43040614.05

If I query rate(ecs_cpu_seconds_total[2m]) * 100

I get very large numbers, 304131.45438179886 and 376788.3762791756 for core 0 and 1 for the heartbeat container for instance.

If it matters, im using something close to this: https://github.com/dwp/docker-ecs-service-discovery Which is allowing prom to find the container.

The end goal is toi graph the CPU usage of each container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions