0

Does Prometheus expose any metrics on itself? i.e. how much disk space it's using etc.

I want to start fine tuning our prometheus server, so need to monitor what's currently there. I want to be able to see how much disk space it using.

Prometheus v2.31 installed via apt on Ubuntu Linux 22.04 LTS.

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253

1 Answers1

2

The /metrics endpoint should be enabled by default (couldn't find any documentation on enabling/disabling this feature, seems to be always on)

Prometheus needs to be configured to scrape the metrics endpoint from itself:

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs:
      - targets: ['localhost:9090']

Taken from the getting started guide.

I guess the most relevant metric from the Prometheus endpoint regarding disk space usage would be: prometheus_tsdb_storage_blocks_bytes

But for fine tuning and profiling you might want to install prometheus node exporter as well.

Henrik Pingel
  • 9,380
  • 2
  • 28
  • 39