Prometheus - Prometheus.yml

Table of contents:

my global config

global: scrape_interval: 30s # Set the scrape interval to every 15 seconds. Default is every 1 minute. scrape_timeout: 15s evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s).

Alertmanager configuration

alerting: alertmanagers:

  • static_configs:
    • targets:

      - alertmanager:9093

Load rules once and periodically evaluate them according to the global ‘evaluation_interval’.

rule_files: # - “first_rules.yml” # - “second_rules.yml”

A scrape configuration containing exactly one endpoint to scrape:

Here it’s Prometheus itself.

scrape_configs: # The job name is added as a label job=<job_name> to any timeseries scraped from this config.

  • job_name: ‘prometheus’ metrics_path: ‘/metrics’ scheme: ‘http’ static_configs:
    • targets: [‘x.x.x.x:9100’]
  • job_name: ‘netdata’ metrics_path: ‘/api/v1/allmetrics?format=prometheus’ scheme: ‘http’ static_configs:
    • targets: [‘x.x.x.x:19999’,’x.x.x.x:19999’]
  • job_name: ‘wmi’ metrics_path: ‘/metrics’ scheme: ‘http’ static_configs:
    • targets: [‘x.x.x.x:9182’,’x.x.x.x:9182’]
  • job_name: ‘snmp’ static_configs:
    • targets: [‘x.x.x.x’,’x.x.x.x’] metrics_path: /snmp params: module: [if_mib] relabel_configs:
    • source_labels: [address] target_label: __param_target
    • source_labels: [__param_target] target_label: instance
    • target_label: address replacement: x.x.x.x:9116 # Docker IP with SNMP exporter.
  • job_name: ‘fortigate’ static_configs:
    • targets: [‘x.x.x.x’,’x.x.x.x’] metrics_path: /snmp params: module: [fortigate_snmp] relabel_configs:
    • source_labels: [address] target_label: __param_target
    • source_labels: [__param_target] target_label: instance
    • target_label: address replacement: x.x.x.x:9116 # Docker IP with SNMP exporter.