Running Prometheus

All Topics

A Minimal prometheus.yml

A Minimal prometheus.yml

scrape_interval: 15s — collect metrics every 15 seconds. This defines how often Prometheus pulls metrics from its targets. Fifteen seconds is a reasonable default: frequent enough for visibility, but not too heavy for most systems.

A job named prometheus that scrapes itself. Prometheus exposes its own internal metrics at localhost:9090/metrics. Scraping itself allows you to monitor Prometheus performance and health.

This is the default configuration shipped with Prometheus. When you download Prometheus, it includes a simple config that monitors only itself.

Start small and expand gradually. Begin with this minimal setup, then add more scrape_configs as you introduce new applications, exporters, or infrastructure components.

Minimal prometheus.yml

global:
  scrape_interval: 15s  # Scrape targets every 15 seconds

scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090"]

This configuration sets a global scrape interval, defines one job, and scrapes Prometheus itself.