The LeanSignal Agent is a custom OpenTelemetry Collector
distribution that collects telemetry — metrics, logs, and traces — writes
everything to co-located stores for full local fidelity, and forwards only
the demanded subset to a central, long-retention dataplane. Each signal has
its own local store:
VictoriaMetrics for metrics,
Loki for logs, and
Tempo for traces.
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 set down, and edit-mode queries both ways, so the LeanSignal UI can
read your full-fidelity local stores without them 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 filters forward nothing by default — only the telemetry a declared
demand asks for ever leaves your network. Central cost follows value, not
volume, and the agent is the component that enforces it:
Everything is written to the local store for each signal next to the agent —
metrics to VictoriaMetrics, logs to Loki, traces to Tempo.
The edge controller keeps one persistent, outbound gRPC stream to LeanSignal:
it reports the discovered metric/timeseries index, receives the demand
set (metric names, log stream selectors, and trace resource selectors), and
answers edit-mode queries the UI runs against the local stores (read-only,
allow-listed — the stores are never exposed to the internet).
A demand filter per signal drops everything not demanded before it reaches
the central dataplane — so the central stores only hold what's asked for. In
production the agent remote-writes demanded metrics through vmauth, and
pushes demanded log streams and trace spans to the tenant Loki/Tempo through the
ingest ingress, all authenticated by its agent key.
central (default) — the full agent above: co-located stores (VictoriaMetrics,
Loki, Tempo), the metrics tracker, per-signal demand filters, 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 stores, tracker, demand
filters, 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 stores + 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 its co-located stores (VictoriaMetrics, Loki, Tempo), view the
agent's own 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 + its co-located stores (VictoriaMetrics for metrics, Loki for
logs, Tempo for traces) and registers them as services (systemd / launchd).
--agent-name labels this host's telemetry. See
docs/install-linux.md and
docs/install-macos.md.
The fastest way to try the agent against a tenant — runs the agent and its
co-located stores (VictoriaMetrics, Loki, Tempo) 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 co-located stores run as separate services, and each
store's data lives in a fixed directory outside the binaries — so upgrading the
agent never stops those stores or touches their 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)
Apache 2.0 — see LICENSE and NOTICE. Bundles OpenTelemetry
Collector, and pairs with VictoriaMetrics, Loki, and Tempo as co-located stores
(all Apache 2.0).
Package resolveprovider implements a confmap.Provider (scheme "leansignal") that resolves a tenant's region from the LeanSignal control-center at startup and derives every backend URL the agent needs from the tenant slug + region.
Package resolveprovider implements a confmap.Provider (scheme "leansignal") that resolves a tenant's region from the LeanSignal control-center at startup and derives every backend URL the agent needs from the tenant slug + region.
Package leansignalselectormatch is a small parser + evaluator for the canonical normalized label-selector grammar that lean-api uses for ALL demand domains (LogQL stream selectors for logs, resource selectors for traces, metric series selectors for metrics):
Package leansignalselectormatch is a small parser + evaluator for the canonical normalized label-selector grammar that lean-api uses for ALL demand domains (LogQL stream selectors for logs, resource selectors for traces, metric series selectors for metrics):
Package tracedemand holds the trace-routing value type shared by the edge controller (which receives it in the demand set) and the trace demand filter (which routes spans by it).
Package tracedemand holds the trace-routing value type shared by the edge controller (which receives it in the demand set) and the trace demand filter (which routes spans by it).