LOGBOOK

HELP

Quiz Entry - updated: 2026.10.01

The default prometheus.yml contains a job prometheus with targets: ["localhost:9090"]. What does it do, and why is it there?

Prometheus scrapes itself. The server exposes metrics about its own health and performance on /metrics at port 9090, and this job collects them like those of any exporter.

scrape_configs:
  - job_name: "prometheus"
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
      - targets: ["localhost:9090"]
  • job_name is added as the label job="prometheus" to every series this job scrapes.
  • static_configs / targets is a fixed list of host:port endpoints (as opposed to service discovery).
  • Defaults: path /metrics, scheme http, so the URL scraped is http://localhost:9090/metrics.

Why: the monitoring system should be monitored too: scrape durations, number of series, rule evaluation time, storage size. It also gives a working example out of the box.

To add a Windows and a Debian exporter, you append one job per target:

  - job_name: "win"
    static_configs:
      - targets: ["windows-xxx.example:9182"]
  - job_name: "deb"
    static_configs:
      - targets: ["debian-xxx.example:9100"]

YAML is indentation-sensitive, so a misaligned line stops Prometheus from starting. After systemctl restart prometheus, journalctl -eu prometheus.service shows config errors, and the /targets page shows whether each target is UP.

Go deeper:

From Quiz: ITIA / Monitoring Lab: Prometheus and Grafana | Updated: Oct 01, 2026