Prometheus configuration: Difference between revisions

From wikinotes
Line 1: Line 1:
= Prometheus =
= Prometheus =
<blockquote>
<blockquote>
== Consuming Exporters ==
== Exporters ==
<blockquote>
<blockquote>


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


Line 22: Line 22:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Exporters -->
</blockquote><!-- Exporters -->
== Rules ==
<blockquote>
</blockquote><!-- Rules -->
</blockquote><!-- Prometheus -->
</blockquote><!-- Prometheus -->

Revision as of 02:23, 16 February 2022

Prometheus

Exporters

Configure jobs to poll prometheus metric exporter 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:      my-server
    metrics_path:  /metrics   # (default) route to query metrics from
    scheme:        http       # (default) scheme to use for query
    static_configs:
      - targets:
        - localhost:9115      # query this ip-addr/port

Rules