The LeanSignal Agent is a custom OpenTelemetry Collector
distribution that collects metrics, keeps a live metric index in sync with
the LeanSignal control plane, writes everything to a co-located
VictoriaMetrics for full local fidelity, and
forwards only the demanded subset to a central, long-retention dataplane.
The agent lives in your network and dials out to LeanSignal — it needs no
inbound access. A single long-lived gRPC stream carries the metric index up,
the demand list down, and edit-mode queries both ways, so the LeanSignal UI can
read your full-fidelity local store without that store ever being exposed.
It runs on Kubernetes, Linux, macOS, and Windows, and is released under the
Apache 2.0 license.
How it works
The agent is the edge half of LeanSignal's demand-driven Value Cycle. It
sees everything your workloads emit and keeps it at full fidelity locally, but
its filter forwards nothing by default — only the metrics a declared
demand asks for ever leave your network. Central cost follows value, not
volume, and the agent is the component that enforces it:
Everything is written to the local VictoriaMetrics next to the agent.
The edge controller keeps one persistent, outbound gRPC stream to LeanSignal:
it reports the discovered metric/timeseries index, receives the demand
list, and answers edit-mode queries the UI runs against the local store
(read-only, allow-listed — the store is never exposed to the internet).
The demand filter drops everything not on the demand list before metrics
reach the central dataplane — so the central store only holds what's asked for.
In production the agent remote-writes the demanded subset through vmauth,
authenticated by its agent key.
central (default) — the full agent above: local VictoriaMetrics, tracker,
demand filter, dataplane forwarding, and the gRPC control channel.
edge — a lightweight OTLP forwarder. It collects host metrics, OTLP from
local apps, and its own self-telemetry, stamps identity labels, and ships
everything as OTLP to a central agent. No local VM, tracker, demand filter,
or control channel. Selected by giving the central agent's OTLP endpoint at
install (--central-url HOST:PORT or CENTRAL_AGENT_GRPC_URL).
Host A (edge) ─┐
Host B (edge) ─┼─ OTLP ─▶ Host C (central) ─▶ local VM + demanded → dataplane
Host C (central)┘
This fans many edge agents across networks into one central aggregation point.
Every metric carries leansignal_agent_name, host_name, os_type, and
leansignal_mode (edge/central) labels, so each source stays distinct in the
shared store. The central
agent's OTLP receiver is open and unauthenticated by design — keep it on a
trusted/internal network. See docs/configuration.md.
Quick start
Managing an install — how to check service status, start/stop/restart
the agent and VictoriaMetrics, view logs, and uninstall is covered in the
per-OS guide for your platform:
Linux · macOS ·
Windows · Kubernetes.
Kubernetes (Helm)
You only need your agent key and your tenant — the gRPC control host
(<tenant>-grpc.<domain>) and the ingest host (<tenant>-ingest.<domain>) are
derived (domain defaults to eu11.leansignal.io; override with
--set leansignal.domain=…).
Installs the agent + local VictoriaMetrics and registers them as services
(systemd / launchd). --agent-name labels this host's metrics. See
docs/install-linux.md and
docs/install-macos.md.
The fastest way to try the agent against a tenant — runs the agent and a local
VictoriaMetrics as containers:
export LEANSIGNAL_ENDPOINT=... LEANSIGNAL_AGENT_KEY=... LEANSIGNAL_DATAPLANE_ENDPOINT=...
docker compose -f deploy/docker/docker-compose.yaml up
Upgrading
The agent and its local VictoriaMetrics run as separate services, and VM's
data lives in a fixed directory outside the binaries — so upgrading the agent
never stops VictoriaMetrics or touches its data. That's the default. Upgrading
VictoriaMetrics is a separate, snapshot-first, opt-in step. Both paths roll back
automatically if the service doesn't come back healthy. Full guide:
docs/upgrading.md.
make install-tools # OCB, addlicense, goreleaser (one-time)
make test # go test -race ./components/...
make local-build # OCB-generate (if needed) + compile -> _build/leansignal-agent
Then run the prebuilt binary — no recompile — against a local or a cloud
LeanSignal:
make local-run # vs local lean-api (:9090, h2c) + local VM (:8482)
make cloud-run TENANT=mb1 AGENT_KEY=… # vs a cloud tenant over TLS (…-grpc.<domain>:443)
Package promnaming builds Prometheus metric names for OTLP metrics using the exact translator (github.com/prometheus/otlptranslator) that the prometheusremotewrite exporter uses.
Package promnaming builds Prometheus metric names for OTLP metrics using the exact translator (github.com/prometheus/otlptranslator) that the prometheusremotewrite exporter uses.