aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prometheus_data_size.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/prometheus_data_size.rb b/prometheus_data_size.rb
new file mode 100644
index 0000000..4b361b6
--- /dev/null
+++ b/prometheus_data_size.rb
@@ -0,0 +1,19 @@
+class PrometheusDataSize
+ def initialize(collector, config)
+ @collector = collector
+ @path = "/mnt/lustre/groups/prometheus/data"
+ end
+
+ def raid
+ bytes = `du -sb #{@path}`.split[0].to_i
+
+ @collector.redact!("prometheus_data_size")
+ @collector.report!(
+ "prometheus_data_size",
+ bytes,
+ help: "Size of the prometheus data directory in bytes",
+ type: "gauge",
+ labels: { path: @path }
+ )
+ end
+end