Examples courtesy of Jason Leach.
avg(container_cpu_cfs_throttled_periods_total / container_cpu_cfs_periods_total {namespace=~"4a9599-prod", pod=~".*mediator.*", container_name!="POD", image!=""} * 100) BY (pod)
- The namespace portion of the query can be a problem when querying inside a namespace.
$ cat /sys/fs/cgroup/cpu/cpu.stat
nr_periods 123978
nr_throttled 17778
throttled_time 360587202704
nr_throttled/nr_periods * 100
= 17778 / 123978 * 100
= Container is throttled 14.34%
of the time