Dashboards - Building and Using Grafana Dashboards
Dashboards are the reason you set up this entire stack. This chapter covers importing pre-built community dashboards, building custom panels, and organizing your observability view.
Opening the Dashboard Area
- Open Grafana at http://localhost:3000 (or your server IP)
- Login with admin / admin123 (or whatever you set)
- In the left sidebar, click the grid icon (Dashboards)
Option 1 - Import Community Dashboards (Fastest Way to Start)
Grafana.com hosts thousands of pre-built dashboards. You import them with a single ID number.
Import a Dashboard
- Click Dashboards in sidebar
- Click New > Import
- Enter the dashboard ID number in the "Import via grafana.com" field
- Click Load
- Select your data source when prompted (e.g., Prometheus)
- Click Import
Best Dashboard IDs to Import
Node Exporter Full (host metrics - CPU, RAM, disk, network):
- ID: 1860
- Data source: Prometheus
- This is the most popular Linux server dashboard on Grafana.com
Node Exporter Full (alternative, cleaner layout):
- ID: 11074
- Data source: Prometheus
Prometheus Stats (monitor Prometheus itself):
- ID: 3662
- Data source: Prometheus
Docker Containers (if you run Docker):
- ID: 193
- Data source: Prometheus
Loki Dashboard:
- ID: 13639
- Data source: Loki
Node.js Application Dashboard (prom-client metrics):
- ID: 11159
- Data source: Prometheus
Tempo / Traces Dashboard:
- ID: 16098
- Data source: Tempo
Option 2 - Build a Custom Dashboard
Create a New Dashboard
- Click Dashboards > New > New Dashboard
- Click Add visualization
- Choose a data source (Prometheus, Loki, or Tempo)
- Build your panel using the query editor
Panel Types
| Panel Type | Best Used For |
|---|---|
| Time series | Metrics over time (CPU, requests/sec) |
| Stat | Single current value (uptime, total requests) |
| Gauge | Percentage-style display (disk usage %) |
| Bar chart | Comparing values (requests per endpoint) |
| Logs | Log stream output from Loki |
| Table | Multiple values in rows (top slow endpoints) |
| Node graph | Service dependency map |
| Traces | Tempo trace explorer |
Essential Panels to Build
Panel 1 - CPU Usage (Time Series)
Data source: Prometheus Query (PromQL):
100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
Title: CPU Usage % Unit: Percent (0-100) Alert threshold: 80
Panel 2 - Memory Available (Stat)
node_memory_MemAvailable_bytes / 1024 / 1024 / 1024
Title: Available RAM Unit: Gigabytes Min value: 0
Panel 3 - Disk Usage (Gauge)
100 - ((node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) * 100)
Title: Disk Usage Unit: Percent Thresholds: 70 = yellow, 85 = red
Panel 4 - HTTP Request Rate (Time Series)
If your app exposes prom-client metrics:
rate(healthtune_http_request_duration_seconds_count[5m])
Title: Requests per Second Unit: Requests/sec
Panel 5 - Error Rate (Time Series)
rate(healthtune_http_request_duration_seconds_count{status=~"5.."}[5m])
Title: 5xx Errors per Second Unit: Errors/sec
Panel 6 - P95 Response Time (Time Series)
histogram_quantile(0.95, rate(healthtune_http_request_duration_seconds_bucket[5m]))
Title: P95 Latency Unit: Seconds
Panel 7 - Live Logs (Logs Panel)
Data source: Loki Query (LogQL):
{app="healthtune_api"}
Title: HealthTune Live Logs Set Deduplication to Exact to remove duplicate log lines
Panel 8 - Error Logs Only (Logs Panel)
{level="error"}
Title: All Service Errors This shows errors from ALL services in one panel
Organize Your Dashboard
Add Rows (Section Headers)
In the dashboard, click Add > Row. Use rows to group related panels:
- Row: Server Health (CPU, RAM, Disk panels)
- Row: HealthTune API (request rate, errors, latency)
- Row: TrackX API (same metrics for TrackX)
- Row: Logs (log panels)
Dashboard Variables (Dynamic Dropdowns)
Add a variable to switch between apps without editing queries.
- In dashboard settings (gear icon), click Variables > New Variable
- Settings:
- Type: Custom
- Name: app
- Label: Application
- Values: healthtune_api,trackx_api
- Save
Then use the variable in your LogQL queries:
{app="$app"}
Now a dropdown appears at the top of the dashboard to switch between apps.
Set Auto-Refresh
In the top-right corner of the dashboard, set the refresh interval:
- 30s for development
- 1m or 5m for production dashboards
Explore - Ad-Hoc Queries
Grafana Explore mode lets you run one-off queries without building a dashboard panel. Perfect for debugging.
Explore with Prometheus
- Click Explore (compass icon in sidebar)
- Select Prometheus
- Type PromQL query:
node_load1
See the 1-minute load average over the last hour.
Explore with Loki
- Select Loki
- Use Label filters to pick app = healthtune_api
- Or type LogQL directly:
{app="healthtune_api"} |= "error" | json | level="error"
Explore with Tempo (Find a Trace)
- Select Tempo
- Query type: Search
- Service name: healthtune_api
- Min duration: 500ms (find slow requests)
- Click Run query
- Click any result to see the full trace waterfall
Save and Share Dashboards
Save a Dashboard
Click the floppy disk icon (Save dashboard) in the top right. Add a name and optional description.
Export a Dashboard as JSON
- Dashboard settings (gear icon) > JSON Model
- Copy the JSON or click Download JSON
- This lets you commit your dashboards to Git or import them on another Grafana instance
Import Dashboard from JSON
- Dashboards > New > Import
- Paste JSON or upload .json file
- Click Import
Share a Panel or Dashboard
Click the share icon (arrow leaving box) on any panel to get:
- A direct URL to the panel at a specific time range
- An embed code for iframes
- A snapshot (public read-only version, no login required)
Mark Your Main Dashboard as Home
- Open the dashboard you want as your home screen
- Click the star icon to favorite it
- Go to Grafana Settings (gear in bottom-left sidebar) > Default preferences
- Set Home Dashboard to your dashboard
Now every login lands directly on that dashboard.