Prometheus configuration: Difference between revisions
From wikinotes
No edit summary |
|||
Line 37: | Line 37: | ||
</blockquote><!-- Exporters --> | </blockquote><!-- Exporters --> | ||
== | == Rules == | ||
<blockquote> | <blockquote> | ||
You can configure ''' | You can configure '''Rules''' to either persist or '''Alerts'''. | ||
<syntaxhighlight lang="yaml"> | <syntaxhighlight lang="yaml"> |
Revision as of 01:43, 18 February 2022
This is just an overview of prometheus configuration.
Details on syntax and exporter configs can be found in:
Documentation
configuration docs https://prometheus.io/docs/prometheus/latest/configuration/configuration/
Prometheus
Exporters
Configure jobs to poll prometheus metric exporter endpoints within
scrape_configs
.
For example, the following config polls metrics fromhttp://localhost:9115/metrics
every5s
.# /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/portRules
You can configure Rules to either persist or Alerts.
global: evaluation_interval: 15s # rules evaluated every 15s alerting: alertmanagers: - static_configs: - targets: - alertmanager:9003 rule_files: - first_rules.yml