docker: add container_id also to per cpu stats
currently this field exists only for total cpu usage closes #1168
This commit is contained in:
committed by
Cameron Sparr
parent
36b9e2e077
commit
5deb22a539
@@ -307,7 +307,11 @@ func gatherContainerStats(
|
||||
for i, percpu := range stat.CPUStats.CPUUsage.PercpuUsage {
|
||||
percputags := copyTags(tags)
|
||||
percputags["cpu"] = fmt.Sprintf("cpu%d", i)
|
||||
acc.AddFields("docker_container_cpu", map[string]interface{}{"usage_total": percpu}, percputags, now)
|
||||
fields := map[string]interface{}{
|
||||
"usage_total": percpu,
|
||||
"container_id": id,
|
||||
}
|
||||
acc.AddFields("docker_container_cpu", fields, percputags, now)
|
||||
}
|
||||
|
||||
for network, netstats := range stat.Networks {
|
||||
|
||||
Reference in New Issue
Block a user