summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2022-06-29 18:23:22 +0300
committerGitHub <noreply@github.com>2022-06-29 18:23:22 +0300
commitf5a49bd9ab48b0e5569165cb7f6dcb5362048bd6 (patch)
tree147dda0ca0f5001482a20c5a49c5dff2b8b3b942 /collectors
parentb92f5a3271bb0fb7d16b2c406e473eec7bd68102 (diff)
Add fstype labels to disk charts (#13245)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c
index 63c3837dfa..f2d9e93ba9 100644
--- a/collectors/diskspace.plugin/plugin_diskspace.c
+++ b/collectors/diskspace.plugin/plugin_diskspace.c
@@ -42,6 +42,8 @@ struct mount_point_metadata {
int updated;
int slow;
+ DICTIONARY *chart_labels;
+
size_t collected; // the number of times this has been collected
RRDSET *st_space;
@@ -253,6 +255,8 @@ static void calculate_values_and_show_charts(
);
}
+ rrdset_update_rrdlabels(m->st_space, m->chart_labels);
+
m->rd_space_avail = rrddim_add(m->st_space, "avail", NULL, (collected_number)bsize, 1024 * 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
m->rd_space_used = rrddim_add(m->st_space, "used", NULL, (collected_number)bsize, 1024 * 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
m->rd_space_reserved = rrddim_add(m->st_space, "reserved_for_root", "reserved for root", (collected_number)bsize, 1024 * 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
@@ -295,6 +299,8 @@ static void calculate_values_and_show_charts(
);
}
+ rrdset_update_rrdlabels(m->st_inodes, m->chart_labels);
+
m->rd_inodes_avail = rrddim_add(m->st_inodes, "avail", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
m->rd_inodes_used = rrddim_add(m->st_inodes, "used", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
m->rd_inodes_reserved = rrddim_add(m->st_inodes, "reserved_for_root", "reserved for root", 1, 1, RRD_ALGORITHM_ABSOLUTE);
@@ -424,6 +430,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
.rd_inodes_reserved = NULL
};
+ mp.chart_labels = rrdlabels_create();
+ rrdlabels_add(mp.chart_labels, "fstype", mi->filesystem, RRDLABEL_SRC_AUTO);
+
m = dictionary_set(dict_mountpoints, mi->mount_point, &mp, sizeof(struct mount_point_metadata));
m->slow = slow;