Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.05 KB

prometheus.rst

File metadata and controls

42 lines (28 loc) · 1.05 KB

Prometheus

You can export statistics to a Prometheus server through an exporter. When the --export-prometheus is used, Glances creates a Prometheus exporter listening on <host:port> (define in the Glances configuration file).

[prometheus]
host=localhost
port=9091
prefix=glances
labels=src:glances

Note: you can use dynamc fields for the label (ex: labels=system:uname -s)

and run Glances with:

$ glances --export prometheus

You can check that Glances exports the stats using this URL: http://localhost:9091

image

In order to store the metrics in a Prometheus server, you should add this exporter to your Prometheus server configuration with the following lines (in the prometheus.yml configuration file):

scrape_configs:
  - job_name: 'glances_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9091']

image