vm-observer: Monitoring the Edge with an Enterprise Backbone

How one developer used Apache Kafka and Go to turn simple VM telemetry into a resilient, event-driven stream.

arffsaad/vm-observer

An enormous, ornate industrial pipeline catching a minor glass marble from a tiny mechanical robot, while a scientist catches it at the other end. This illustrates using heavy enterprise infrastructure for small data packets.
Using an enterprise-grade message broker to transport simple telemetry data ensures at-least-once delivery.

Key Takeaways

The Heavy-Duty Pipe

Most weekend projects designed to monitor virtual machines rely on simple architectures. They usually deploy a lightweight script that pings an HTTP endpoint or opens a WebSocket. The developer behind vm-observer chose a completely different path. They built a distributed system using Apache Kafka as the backbone.

This is architectural overkill for checking if a server is out of disk space. But that is exactly what makes the repository fascinating. It is a masterclass in applying Big Tech infrastructure to a Small Tech problem. By decoupling data collection from visualization, the system gains enterprise-grade resilience.

The architecture relies on a strict separation of concerns. A Go-based agent sits on the edge, pushing metrics into the Kafka broker. A Laravel application sits on the control plane, consuming those metrics at its own pace. If the dashboard goes down, the broker simply holds the messages. When the dashboard returns, it processes the backlog without losing a single data point.

The One-Line Onboarding

Deploying agents across a fleet of scattered VMs is notoriously painful. The vm-observer project solves this with a clever approach to configuration management. The entire connection profile is packed into a single Base64-encoded string.

A glowing glass suitcase containing a brass key, a compass, a name tag, and a map. This represents the self-contained Base64 connection string.
The Base64 string bundles Kafka credentials, server IPs, and device IDs into a single, portable argument.

When a user adds a new device in the dashboard, Laravel generates a unique UUID and bundles it with the Kafka server IP, topic name, and SASL credentials. The user then runs a single shell script on their target machine. This script downloads the Go agent, compiles it, and registers it as a systemd service using the provided string.

This design keeps the edge agent incredibly thin. It contains no complex parsing logic or local configuration files. It simply decodes the string, connects to the broker using SCRAM-SHA-512 authentication, and begins transmitting.

Consuming the Stream

The control plane is where the raw data becomes useful. Built on Laravel 11, the backend uses a dedicated Artisan command to act as a long-running Kafka consumer. This process listens to the broker stream, mapping incoming JSON payloads to database records using the device UUIDs.

The circular data flow from the Laravel UI to the edge agent and back through the Kafka consumer.

To surface these updates in real-time, the project avoids heavy Single Page Application frameworks. Instead, it relies on Livewire. The dashboard components use Livewire's polling capabilities to refresh the UI automatically as the database updates.

Architecture vs. Simplicity

The decision to use an event-driven stream over traditional HTTP polling fundamentally changes the operational characteristics of the tool. It trades setup simplicity for inherent scalability.

Featurevm-observer (Kafka Stream)Traditional Agent (HTTP Polling)
TransportEvent-driven (Push)REST / HTTP (Pull)
StoragePersistent Broker StreamDirect to Database
Setup ComplexityHigh (Requires Kafka/Zookeeper)Low (Standalone Binary)
Delivery GuaranteeAt-least-onceBest-effort

Traditional monitors often struggle when dealing with thousands of concurrent connections. The database becomes the bottleneck. By inserting Kafka into the ingest path, vm-observer pushes that concurrency limit out to the broker, which is explicitly designed to handle massive throughput.

The Origin and Vision

Building a tool like this requires balancing practical needs with architectural exploration. For a solo developer, the project serves as both a utility and a proving ground for robust system design.

vm-observer is a tool I built to easily monitor my VMs. It collects metrics and provides a simple dash.

arffsaad, Creator & Maintainer · arffsaad on X

The result is a system that feels familiar on the frontend but hides a surprisingly resilient engine under the hood. It proves that combining modern PHP frameworks with Go-powered edge agents and enterprise message brokers can yield reliable, decoupled observability stacks.