ar51an/unbound-dashboard
About
Unbound dashboard in Grafana with Prometheus and Loki.
Developer ToolsMeasured star growth
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalunbound dashboard

Summary
🔸 Unbound dashboard in Grafana
🔸 Prometheus time series database
🔸 Unbound metrics exporter in Go
🔸 Log aggregation with Loki
🔸 Unbound setup is available at unbound-redis
🔸 Refer to info.md for dashboard details and release.md for changes
Specs:
Grafana Prometheus Loki Go OS HW 11.1.02.42.03.1.01.21.5raspios-bookworm-arm64-liteRaspberry Pi 4 Model B
Steps
🔸 Grafana ➜ Prometheus ➜ Unbound Exporter ➜ Loki ➜ Import Dashboard
❯ Grafana
Download:
There are 2 versions OSS and Enterprise. OSS version is more than enough. Enterprise version installs too many extra packages (like unattended-upgrades and more). Below cmd downloads Grafana OSS for arm64.wget https://dl.grafana.com/oss/release/grafana_11.1.0_arm64.debInstall:
sudo apt install muslℹ️Note:muslpackage is required since Grafana 10.2.3sudo dpkg -i grafana_11.1.0_arm64.debℹ️Note:
A tweakedgrafana.iniis available in the release. It reduces memory footprint, removes usage collection, stops calls to grafana server/repo and has few more optimizations. You can use grafana.ini either from the release or the default one. Default config is located at/etc/grafana/grafana.iniStart:
sudo systemctl daemon-reloadsudo systemctl enable grafana-serversudo systemctl start grafana-serverUI:
http://<RP-IP>:3000/
Default user/pass ➟ admin/admin
❯ Prometheus
Install:
sudo apt install prometheusConfig:
Enable unbound-exporter scraping in prometheus. A trimmed down prometheus config,prometheus.ymlis available in the release. Take a backup of existing prometheus.yml, if you are interested in the default config. Copyprometheus.ymlfrom the release to/etc/prometheus/dir.ℹ️Note:
Providedprometheus.ymlhas only unbound-exporter metric collection enabled. Default metric collection for node and prometheus exporters are removed. Scraping interval is set to 5m.Remove Node Exporter:
Node exporter exports machine metrics. It is installed as part of prometheus pkg and runs as systemd service. It is not needed for unbound-dashboard. Unless you are already using it, remove node exporter. Below cmd will remove 8 node-exporter related pkgs.Remove:
sudo apt --purge autoremove prometheus-node-exporter
Disable scrape config:
Providedprometheus.ymlhas node exporter scrapping config removed.UI:
http://<RP-IP>:9090/
❯ Unbound Exporter
I wrote my own exporter in
Go. It is more efficient and tailored for this dashboard. A prebuilt binary (for arm64) is available in the release. Source code is available at unbound-exporter.Config:
Modify Unbound config. Edit/etc/unbound/unbound.confEnable extended stats. Add option under
server:tagextended-statistics: yesEnable Unix domain socket for collecting stats. It is faster than default TCP. Add below options under
remote-control:tagcontrol-interface: "/var/run/unbound.sock"control-use-cert: no
Install:
Copyunbound-exporterbinary from the release to/usr/local/bin/dir. Make sure it is under ownership of root and executable.Change ownership [If needed]:
sudo chown root:root /usr/local/bin/unbound-exporter
Make it executable [If needed]:sudo chmod +x /usr/local/bin/unbound-exporterService:
Create service to automatically run unbound-exporter at startup. Copyprometheus-unbound-exporter.servicefrom the release to/etc/systemd/system/dir. Make sure it is under the ownership of root. Enable and start the service.Change ownership [If needed]:
sudo chown root:root /etc/systemd/system/prometheus-unbound-exporter.service
Enable:sudo systemctl enable prometheus-unbound-exporter
Start:sudo systemctl start prometheus-unbound-exporter
Status:sudo systemctl status prometheus-unbound-exporterℹ️Note:
Providedprometheus-unbound-exporter.servicepasses 2 paramaters. Blocklist file path and Unbound unix domain socket URI. Change them accordingly if you are using different path and name.Usage:
unbound-exporter -h
❯ Loki
Download:
DownloadLokiandPromtailcurl -O -L "https://github.com/grafana/loki/releases/download/v3.1.0/loki_3.1.0_arm64.deb"curl -O -L "https://github.com/grafana/loki/releases/download/v3.1.0/promtail_3.1.0_arm64.deb"Install:
sudo dpkg -i loki_3.1.0_arm64.debsudo dpkg -i promtail_3.1.0_arm64.debLogging:
Enable Unbound logging.Edit
/etc/unbound/unbound.conf. Add/Modify below options underserver:taglog-replies: yeslog-tag-queryreply: yeslog-local-actions: yeslogfile: /var/log/unbound/unbound.logℹ️Note:
Make sureverbosity:is set to 0.Create log dir
sudo mkdir /var/log/unboundsudo chown unbound:unbound /var/log/unboundEnable log rotation
Copy file
unboundfrom the release under logrotate dir to/etc/logrotate.d/dir. Make sure it is under the ownership of root.
Config:
Replace/etc/loki/config.ymland/etc/promtail/config.ymlwith theconfig.ymlfiles in the release under loki and promtail dirs respectively. Both should be under the ownership of root.ℹ️Note:
Provided lokiconfig.ymlis optimized to process large data set and metrics calculation for Unbound logs. It is tweaked after some thorough testing in Unbound logs specific dashboard with 6 panels. Default loki config can hardly handle 2 panels with small data set, it throws errors and timeouts with large data set and multiple requests.
Provided promtailconfig.ymlenables Unbound logs scrapping.Restart:
sudo systemctl restart lokisudo systemctl restart promtail
❯ Import Dashboard
Open Grafana UI ➟
http://<RP-IP>:3000/Click
Data SourcesunderConfiguration. ClickAdd data sourceselectPrometheus. Add below options:Name ➟
Prometheus
Default ➟On
Add URL ➟http://localhost:9090
Add Scrape interval ➟5m
Hit ➟Save & testClick
Data SourcesunderConfiguration. ClickAdd data sourceselectLoki. Add below options:Name ➟
Loki
Add URL ➟http://localhost:3100
Add Maximum lines ➟100000
Hit ➟Save & testDashboard,
unbound-dashboard.jsonis available in the release. ClickImportunderDashboards. ClickUpload JSON file. Selectunbound-dashboard.json. Add below options:Folder ➟
Dashboards
Select Prometheus ➟Data Source
Select Loki ➟Data Source
Hit ➟Import
❯ ℹ️ Tips & Notes
Grafana:
How to ➟ Change grafanalanding pageto unbound dashboard & Switch betweenDark(default) andLighttheme.Open Grafana UI ➟
http://<RP-IP>:3000/
ClickProfileunder top right icon
UnderPreferencesselectGeneral/UnboundinHome Dashboarddrop down
Change theme inInterface themedrop down
HitSaveThere is an additional panel in the dashboard at the top right, not visible in the preview. It shows unbound-exporter status and may be beneficial. If you are not interested in that simply remove it. Screenshot below:

Prometheus:
How to ➟Removetime series (metrics) collected by prometheus instantly for fresh start & Reduce prometheus journallogging.Enable admin API:
sudo nano /etc/default/prometheus
Add at the top:ARGS="--web.enable-admin-api --log.level=warn"
Save & ExitTo delete all metrics of specific exporter add
job_nameas last argument in delete cmd:
Delete:curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={job="node"}'
Purge:curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/clean_tombstones'
Restart:sudo systemctl restart prometheus
Explore related projects
Loading…