diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2023-04-04 20:50:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 23:50:49 +0300 |
commit | 9ad4519cc31dfecb73b7af3f0f899fc77c6b52b2 (patch) | |
tree | 80dab7f3b5ef89c441cfa869863b381ba2bb1ca0 /collectors/proc.plugin | |
parent | 83b693987771ced3e9535a55a69403fa1242cc09 (diff) |
Add labels for cgroup name (#14856)
Diffstat (limited to 'collectors/proc.plugin')
-rw-r--r-- | collectors/proc.plugin/proc_net_dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/collectors/proc.plugin/proc_net_dev.c b/collectors/proc.plugin/proc_net_dev.c index 9e8127cb67..22cd24dd2c 100644 --- a/collectors/proc.plugin/proc_net_dev.c +++ b/collectors/proc.plugin/proc_net_dev.c @@ -519,6 +519,9 @@ static inline void netdev_rename_cgroup(struct netdev *d, struct netdev_rename * d->chart_family = strdupz("net"); rrdlabels_copy(d->chart_labels, r->chart_labels); + if (strncmp(r->ctx_prefix, "k8s", 3)) { + rrdlabels_add(d->chart_labels, "cgroup_name", r->container_name, RRDLABEL_SRC_AUTO); + } d->priority = NETDATA_CHART_PRIO_CGROUP_NET_IFACE; d->flipped = 1; |