Ravindra BagaleCourses & study guides

Chapter 13: Monitoring Basics

13.6 Prometheus — scrape and store

A minimal scrape idea (YAML shape):

# prometheus.yml — conceptual sketch
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: "lab-node"
    static_configs:
      - targets: ["localhost:9100"]
# After Prometheus is running (per your install docs)
# open Prometheus UI → Status → Targets — expect lab-node UP

What you see: target state UP, last scrape age updating. If DOWN, check exporter process, port, and firewall before blaming Grafana.

Tiny PromQL examples (syntax may need small edits for your metric labels):

# CPU busy idea (illustration — verify metric names on your exporter version)
100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

# Filesystem free bytes — filter to the mount you care about in Grafana
node_filesystem_avail_bytes

You will refine queries inside Grafana panels; the skill today is scrape works → query returns numbers.