Grafana dashboard¶
A dashboard for Grafana comes with the tool:
examples/grafana/fritz-logextractor.json.
Import it with Dashboards → New → Import → Upload dashboard JSON file, or provision it from
a file.
It needs:
- Prometheus scraping the tool's metrics, for the rows Status and Polling.
- Loki with the tool's lines labelled as by the Alloy example:
kind,device,group(events) andlevel(own log), for the rows Events and Tool log.
Either half works without the other; the panels of the missing one stay empty.
Rows¶
| Row | Shows |
|---|---|
| Status | Time since the last read, share of polls that worked, events, rows on the box, rejected rows, state write errors, reboots, how long the latest reboot went unwatched, version |
| Polling | Time since the last read over time, failed polls by reason, rows on the box (a drop is a reboot) |
| Events | Events per group over time, lines per message id, and the event log itself: [group id] message (×repeats), newest first; open a line for all its fields |
| Tool log | The tool's own log lines, warnings and errors by default |
Reboots of the box show as red marks on the time axis.
Filters¶
| Variable | Meaning |
|---|---|
| Prometheus, Loki | The data sources |
| Loki streams | Label matcher for the tool's lines in Loki; default service_name="fritzlogextractor", see below |
| Device | One, several or all devices; applies to metrics and events |
| Group | sys, net, wlan, … |
| Message id | Regular expression on the message id: 506 for one kind of message, 50[0-9] for logins. The id does not depend on the box's language |
| Search | Text the message contains, in any case. Matched literally |
| Tool log level | Levels shown in the row Tool log |
Loki streams. Loki 3.0 and later sets the label service_name on every stream: from
service_name if the collector sets it, else from the first of service, app,
application, app_name, name, app_kubernetes_io_name, container, container_name,
k8s_container_name, component, workload, job, k8s_job_name that the stream has. The
Alloy examples set only job="fritzlogextractor", which gives
service_name="fritzlogextractor". If your collector sets one of the labels before job to
something else, or you run an older Loki, change the variable, e.g. to
job="fritzlogextractor".
Grafana keeps the filters in the URL, so a link to a filtered view can be shared.
Changing it¶
The JSON is generated by examples/grafana/build_dashboard.py. Edit the script and run it
(uv run python examples/grafana/build_dashboard.py); a test checks that the JSON is up to
date and shows every metric.