summaryrefslogtreecommitdiffstats
path: root/src/collectors/ebpf.plugin/ebpf_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/collectors/ebpf.plugin/ebpf_cgroup.c')
-rw-r--r--src/collectors/ebpf.plugin/ebpf_cgroup.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/collectors/ebpf.plugin/ebpf_cgroup.c b/src/collectors/ebpf.plugin/ebpf_cgroup.c
index ae3bf3f8a..9e1fa8231 100644
--- a/src/collectors/ebpf.plugin/ebpf_cgroup.c
+++ b/src/collectors/ebpf.plugin/ebpf_cgroup.c
@@ -329,9 +329,9 @@ void ebpf_parse_cgroup_shm_data()
*/
void ebpf_create_charts_on_systemd(ebpf_systemd_args_t *chart)
{
- ebpf_write_chart_cmd(NETDATA_SERVICE_FAMILY,
- chart->id,
+ ebpf_write_chart_cmd(chart->id,
chart->suffix,
+ "",
chart->title,
chart->units,
chart->family,
@@ -340,9 +340,23 @@ void ebpf_create_charts_on_systemd(ebpf_systemd_args_t *chart)
chart->order,
chart->update_every,
chart->module);
- ebpf_create_chart_labels("service_name", chart->id, RRDLABEL_SRC_AUTO);
+ char service_name[512];
+ snprintfz(service_name, 511, "%s", (!strstr(chart->id, "systemd_")) ? chart->id : (chart->id + 8));
+ ebpf_create_chart_labels("service_name", service_name, RRDLABEL_SRC_AUTO);
ebpf_commit_label();
- fprintf(stdout, "DIMENSION %s '' %s 1 1\n", chart->dimension, chart->algorithm);
+ // Let us keep original string that can be used in another place. Chart creation does not happen frequently.
+ char *move = strdupz(chart->dimension);
+ while (move) {
+ char *next_dim = strchr(move, ',');
+ if (next_dim) {
+ *next_dim = '\0';
+ next_dim++;
+ }
+
+ fprintf(stdout, "DIMENSION %s '' %s 1 1\n", move, chart->algorithm);
+ move = next_dim;
+ }
+ freez(move);
}
// --------------------------------------------------------------------------------------------------------------------