Prometheus configuration: Difference between revisions

From wikinotes
Line 14: Line 14:


scrape_configs:
scrape_configs:
- job_name: blackbox # To get metrics about the exporter itself
- job_name: blackbox     # name of job
   metrics_path: /metrics
   metrics_path: /metrics # (default) route to query metrics from
   static_configs:
   static_configs:
     - targets:
     - targets:
       - localhost:9115
       - localhost:9115   # query this ip-addr/port
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Exporters -->
</blockquote><!-- Exporters -->
</blockquote><!-- Prometheus -->
</blockquote><!-- Prometheus -->

Revision as of 02:14, 16 February 2022

Prometheus

Consuming Exporters

Configure jobs to poll prometheus metric endpoints within scrape_configs.
For example, the following config polls metrics from http://localhost:9115/metrics every 5s.

# /usr/local/etc/prometheus.yml

global:
  scrape_interval: 5s

scrape_configs:
- job_name: blackbox      # name of job
  metrics_path: /metrics  # (default) route to query metrics from
  static_configs:
    - targets:
      - localhost:9115    # query this ip-addr/port