Linux Labs

Observability: metrics, alerts, logs / Stage 1 of 9

Metrics, exporters and scraping

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 7 · summary · 2 min

Summary

  • An exporter serves current values as text: a line is a name, labels and a number, and # TYPE says whether it is a counter or a gauge.
  • Prometheus scrapes the targets in scrape_configs every scrape_interval by itself, adds the job and instance labels and writes up.
  • The scrape state is in /api/v1/targets: health and the reason in lastError; up = 0 means the target did not answer.
  • A new job is a block in prometheus.yml, promtool check config and systemctl reload prometheus.
  • The thousands of lines at the start of the lesson are time series, one per label combination, and the memory free for programs is MemAvailable.
Ubuntu 24.04
Loading…