aboutsummaryrefslogtreecommitdiff
path: root/prometheus_data_size.rb
blob: 4b361b66d09382477def43db3b7ce7d2d0af600e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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