prometheus - The Prometheus monitoring server
prometheus [--config.file=...] [--web.enable-lifecycle] ...
Options you will use
--config.file- Default /etc/prometheus/prometheus.yml.
--web.enable-lifecycle- Enables POST /-/reload and /-/quit. OFF by default (Debian/Ubuntu ARGS=""), so use
systemctl reload prometheus(SIGHUP). --storage.tsdb.retention.time- How long to keep data. Default 15d.
--query.lookback-delta- How far back an instant selector looks for the latest sample. Default 5m.
--config.file=FILE- Prometheus configuration file path (default prometheus.yml; /etc/prometheus/prometheus.yml on Ubuntu).
--storage.tsdb.path=DIR- Base path for metrics storage (default data/).
--storage.tsdb.retention.time=DURATION- How long to retain samples (default 15d).
--storage.tsdb.retention.size=SIZE- Maximum bytes of blocks to keep (e.g. 50GB); the oldest go first.
--web.listen-address=ADDR- Address to listen on for the UI, API and telemetry (default 0.0.0.0:9090).
--query.lookback-delta=DURATION- How far back an instant selector looks for the latest sample (default 5m).
--web.enable-remote-write-receiver- Accept remote write requests on /api/v1/write.
Examples
$ sudo systemctl reload prometheusreload config + rules; a broken config is rejected and the old one keeps running
$ journalctl -u prometheus -n 20see whether the reload worked
Gotchas
- Ubuntu 26.04 ships prometheus 2.53.5 (the 2.53 LTS line). Upstream is on 3.x; the differences that matter here are noted in the lessons.
Try prometheus in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.