Prometheus and PromQL 3 · Configuration, rules and alerts

Scrape targets

A minimal prometheus.yml that scrapes itself and an application every 15 seconds.

global:
  scrape_interval: 15s

rule_files:
  - "rules/*.yml"

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets: ["localhost:9090"]
  - job_name: api
    metrics_path: /metrics
    static_configs:
      - targets: ["api-1:8080", "api-2:8080"]

Official Prometheus and PromQL 3 documentation

More configuration, rules and alerts commands

All configuration, rules and alerts commands · Prometheus and PromQL 3 cheatsheet

Was this page helpful?