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 Monitor | Exporter to Use |
|---|---|
| π₯οΈ CPU, RAM, Disk, Network of the host machine | Node Exporter |
| π³ Docker / Container stats | cAdvisor |
| πΎ TrueNAS system stats | TrueNAS/SNMP Exporter or built-in |
| π Website/service uptime | Blackbox 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
:romeans 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:
| Line | What it means |
|---|---|
scrape_interval: 15s | Every 15 seconds, go collect metrics from all targets |
evaluation_interval: 15s | Every 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? π
Last updated today
Built with Documentation.AI