logo
Prometheus

Prometheus on my Truenas server

It's running as an app on the Truenas server. 30 days retention period.

WebUI: http://192.168.68.89:30104/query

πŸŽ‰ Great Start! Prometheus is Running β€” Now Let's Feed It Data!

You're in a fantastic position! Think of Prometheus like an empty data warehouse β€” it's open for business, but it needs suppliers (called Exporters) to deliver goods (called Metrics). Right now, Prometheus is running but has nothing to scrape yet.

Let me walk you through exactly what to do, step by step.


🧠 First β€” Understand How Prometheus Gets Data

Before we touch anything, here's the mental model:

[Your App/System]  β†’  [Exporter]  β†’  [Prometheus SCRAPES it]  β†’  [Data Stored]

Prometheus is a "puller" β€” it doesn't receive data pushed to it (by default). Instead, it goes out on a schedule (every 15–60 seconds) and pulls metrics from targets called Exporters.


βœ… Step 0 β€” Do This First: Verify Prometheus is Healthy

Before adding any data sources, confirm Prometheus itself is working correctly.

1. Open your WebUI: http://192.168.68.89:30104/

2. Click on Status β†’ Targets

You should see at least one target: Prometheus scraping itself (prometheus job). It should say UP in green.

3. Run this test query in the query box:

up

If you see a result like up{job="prometheus"} = 1, you're healthy and ready to go! βœ…


πŸ“‹ Step 1 β€” Decide What You Want to Monitor

This is the most important planning step. Common things people monitor on a home server / TrueNAS setup:

What to MonitorExporter to Use
πŸ–₯️ CPU, RAM, Disk, Network of the host machineNode Exporter
🐳 Docker / Container statscAdvisor
πŸ’Ύ TrueNAS system statsTrueNAS/SNMP Exporter or built-in
🌐 Website/service uptimeBlackbox Exporter
πŸ“¦ Specific apps (Postgres, Redis, etc.)App-specific exporters

For a first-time setup, I strongly recommend starting with Node Exporter β€” it gives you a goldmine of system-level metrics (CPU, memory, disk, network) with almost no configuration.


πŸ”§ Step 2 β€” Deploy Node Exporter (on TrueNAS)

Since you're on TrueNAS with containers, deploy Node Exporter as another app/container.

Key settings when deploying Node Exporter:

  • Image: prom/node-exporter:latest
  • Port: 9100 (this is where it exposes metrics)
  • Important mount (so it can see the host's real data):
volumes:
  - /proc:/host/proc:ro       # Read-only access to process info
  - /sys:/host/sys:ro         # Read-only access to system info
  - /:/rootfs:ro              # Read-only access to the filesystem

What are these mounts? Node Exporter needs to "peek" at the host operating system's internal files to read CPU, memory, and disk stats. The :ro means read-only β€” it can look but never touch. Totally safe. πŸ”’

The args to pass:

--path.procfs=/host/proc
--path.sysfs=/host/sys
--path.rootfs=/rootfs

Once deployed, verify it's working by visiting:

http://192.168.68.89:9100/metrics

You should see a wall of text β€” those are raw metrics! That's exactly what Prometheus will read. πŸŽ‰


βš™οΈ Step 3 β€” Tell Prometheus to Scrape Node Exporter

This is done via Prometheus's configuration file called prometheus.yml. This file is the brain of Prometheus β€” it tells it who to scrape and how often.

Here's what your config should look like after adding Node Exporter:

global:
  scrape_interval: 15s       # How often Prometheus pulls data from all targets
  evaluation_interval: 15s   # How often it evaluates alerting rules

scrape_configs:

  # Job 1: Prometheus scrapes itself (this is usually pre-configured)
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']  # Prometheus's own metrics endpoint

  # Job 2: Scrape Node Exporter for host system metrics
  - job_name: 'node_exporter'
    static_configs:
      - targets: ['192.168.68.89:9100']  # IP of your TrueNAS host + Node Exporter port

πŸ“– Line-by-Line Breakdown:

LineWhat it means
scrape_interval: 15sEvery 15 seconds, go collect metrics from all targets
evaluation_interval: 15sEvery 15 seconds, check if any alert rules are triggered
job_name: 'node_exporter'A friendly label for this group of targets
static_configs:We're manually listing the targets (as opposed to auto-discovery)
targets: ['192.168.68.89:9100']The address of your Node Exporter container

πŸ”„ Step 4 β€” Reload Prometheus Config

After editing prometheus.yml, tell Prometheus to reload it without restarting:

# Option A: Send a reload signal via HTTP (if lifecycle API is enabled)
curl -X POST http://192.168.68.89:30104/-/reload

# Option B: Restart the Prometheus container from TrueNAS UI
# (Safe β€” 30-day retention data is stored in the volume, not lost on restart)

βœ… Step 5 β€” Verify the New Target is Being Scraped

Go back to: http://192.168.68.89:30104/ β†’ Status β†’ Targets

You should now see two targets, both showing UP:

prometheus    http://localhost:9090/metrics       UP
node_exporter http://192.168.68.89:9100/metrics   UP

Then run this query to confirm data is flowing:

node_cpu_seconds_total

If you get results β€” you're ingesting data! 🎊


πŸ—ΊοΈ Your Full Roadmap Summary

βœ…  DONE     β†’ Prometheus installed & running
πŸ”²  DO NEXT  β†’ Deploy Node Exporter container (port 9100)
πŸ”²  DO NEXT  β†’ Edit prometheus.yml to add the scrape job
πŸ”²  DO NEXT  β†’ Reload config & verify targets are UP
⭐  AFTER    β†’ Install Grafana & connect it to Prometheus
⭐  AFTER    β†’ Import a pre-built dashboard (e.g., Node Exporter Full - Dashboard ID 1860)

πŸ’‘ Pro Tips for Your Setup

  • πŸ“ Find your prometheus.yml β€” On TrueNAS, it's usually in the app's persistent storage volume. Check under your app's settings for the config path.
  • πŸ”’ 30-day retention is great for a home server β€” that's plenty of history.
  • 🎨 Grafana is your next big step β€” Prometheus stores the data, but Grafana makes it beautiful with dashboards and graphs. The two tools are almost always used together!

Would you like me to walk you through deploying Node Exporter on TrueNAS step-by-step, or jump ahead to setting up Grafana? πŸš€