Running Prometheus

All Topics

Starting Prometheus

Starting Prometheus

Run Prometheus with a configuration file.

./prometheus --config.file=prometheus.yml

This starts the Prometheus server using the specified configuration file. If no file is provided, it defaults to prometheus.yml in the current directory.

Important command-line flags.

  • --storage.tsdb.path — Defines where Prometheus stores its time-series database on disk. Default is ./data.
  • --storage.tsdb.retention.time — Controls how long metrics data is kept (e.g., 15d, 30d). After this period, old data is automatically deleted.

These flags help control disk usage and data lifecycle.

Access the Web UI. Open your browser and go to http://localhost:9090. This gives you access to:

  • The expression browser (PromQL queries)
  • Graph visualization
  • Status pages

Verify scrape targets. Visit http://localhost:9090/targets. This page shows all configured targets and their current status. If everything is working correctly, targets should display as UP.

If a target is DOWN, Prometheus cannot reach it — check network, endpoint, or configuration.