LinuxCommandLibrary

prometheus

TLDR

Start Prometheus

$ prometheus --config.file=[prometheus.yml]
copy
Start with storage path
$ prometheus --config.file=[prometheus.yml] --storage.tsdb.path=[/data]
copy
Specify retention
$ prometheus --storage.tsdb.retention.time=[15d]
copy
Enable web admin API
$ prometheus --web.enable-admin-api
copy

SYNOPSIS

prometheus [options]

DESCRIPTION

Prometheus is a monitoring and alerting toolkit that collects metrics from configured targets, stores them, and makes them available for querying and alerting.

PARAMETERS

--config.file file

Configuration file.
--storage.tsdb.path path
Data storage directory.
--storage.tsdb.retention.time duration
Data retention period.
--web.listen-address addr
Listen address.
--web.enable-admin-api
Enable admin endpoints.
--log.level level
Log verbosity.

EXAMPLES

$ # Start with config
prometheus --config.file=prometheus.yml

# Custom port
prometheus --web.listen-address=":9191" \
  --config.file=prometheus.yml

# With retention
prometheus --storage.tsdb.retention.time=30d \
  --config.file=prometheus.yml
copy

CONFIGURATION

$ global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
copy

CAVEATS

Requires configuration file. Default port 9090. Use with Grafana for visualization.

HISTORY

Prometheus was created at SoundCloud starting in 2012 and joined the CNCF in 2016 as the second hosted project.

SEE ALSO

Copied to clipboard