prometheus(8)
Prometheus is a time-series database and monitoring system that collects metrics from applications and infrastructure.
Synopsis
prometheus [OPTION]...Description
Prometheus is an open-source systems monitoring and alerting toolkit. It scrapes metrics from instrumented jobs at given intervals, evaluates alert rules, and can trigger alerts when conditions are met. Metrics are stored in a local time-series database.
Prometheus works by periodically scraping HTTP endpoints that expose metrics in a standardized text format. It stores these metrics with timestamps and allows querying via its expression language (PromQL) and web UI.
Common options
| Flag | What it does |
|---|---|
--config.file=PATH | YAML configuration file path (default: prometheus.yml) |
--storage.tsdb.path=PATH | Directory for time-series database storage (default: data/) |
--storage.tsdb.retention.time=DURATION | Data retention period, e.g. 30d or 1y (default: 15d) |
--web.listen-address=ADDR:PORT | HTTP server listen address (default: 127.0.0.1:9090) |
--web.enable-lifecycle | Enable HTTP endpoints for admin tasks (reload, quit) |
--query.max-samples=N | Maximum number of samples a query can process (default: 50000000) |
--scrape.adjust-timestamps | Adjust metric timestamps to scrape timestamp if they differ |
--log.level=LEVEL | Log level: debug, info, warn, error (default: info) |
Examples
Start Prometheus with specified config file and default storage path
prometheus --config.file=prometheus.ymlStart Prometheus listening on all interfaces, production-style configuration
prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus --web.listen-address=0.0.0.0:9090Start Prometheus keeping 90 days of historical data
prometheus --storage.tsdb.retention.time=90d --config.file=prometheus.ymlEnable admin endpoints to reload configuration without restarting via /-/reload
prometheus --config.file=prometheus.yml --web.enable-lifecycleQuery Prometheus API for the 'up' metric (returns JSON)
curl http://localhost:9090/api/v1/query?query=upReload Prometheus configuration without restart (requires --web.enable-lifecycle)
curl -X POST http://localhost:9090/-/reload