P224 23:31:30 13 FEB
MONITORING MY HOMELAB WITH GRAFANA
17 JUN 2026

Once I had several processes running continuously in my homelab, I needed a single place to inspect what they were doing. Connecting to a machine via SSH and reading logs directly is useful, but hardly convenient, so I set up an observability platform. I use Grafana for querying and visualising logs, Loki for storing and querying logs, and Grafana Alloy for collecting and forwarding logs. The components run as Docker containers on a Raspberry Pi with an attached SSD for persistent storage.

Loki

Loki is a log aggregation system which ingests logs from different sources and stores them centrally. I can then query them directly rather than connecting to individual hosts and inspecting separate log files. For example, my device monitoring service exports its application logs directly to Loki through OpenTelemetry. Loki is configured to store these logs on an attached SSD, so I can access them even if the source machine goes down.

Alloy

Grafana Alloy is a telemetry collector. It gathers logs from services and forwards them to a backend such as Loki, keeping log collection separate from storage and querying.

In my deployment, Alloy reads Docker logs and sends them to Loki. This means a new container becomes immediately observable without a separate log-shipping configuration. Alloy also ships system journal logs to the same Loki instance, allowing me to inspect logs from any process that outputs system-level logs, even if it does not directly support exporting to Loki.

Grafana

Grafana provides a web application for querying and visualising operational data such as logs. It gives me a single place to explore what services are doing, rather than working directly with the underlying data sources.

Grafana data source configuration showing Loki and PostgreSQL

In my deployment, Grafana is provisioned with Loki as a data source, which allows me to explore logs from all sources, including Alloy. I can narrow a search by host, service, or container, then use the surrounding log entries to understand how an application handled a particular event.

Grafana Explore view showing log entries from Loki

My homelab also hosts a PostgreSQL database used by several of my applications. This database is set up as another data source within Grafana, allowing me to query it directly through a web interface. Keeping the data together with logs makes investigation much easier than jumping between a database dashboard and individual log files.

Grafana dashboard showing historical device monitoring data from DB

Reflection

Centralising the logs has made the homelab easier to operate. When a service behaves unexpectedly, I can trace what happened from Grafana rather than connecting to each Pi and comparing separate log files. The setup remains small enough to manage myself, while leaving room to add further log sources as the homelab grows.