leansignal-agent

module
v0.1.0-rc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2026 License: Apache-2.0

README

LeanSignal Agent

License CI Release

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

flowchart LR
  subgraph agent["Agent — your private network"]
    R["Receivers: OTLP, host / k8s metrics"] --> T["leansignalmetrics_tracker"]
    T --> L[("Local VictoriaMetrics<br/>everything")]
    T --> F["leansignal_demand_filter"]
    EC["leansignal_edge_controller"]
    T -.->|index in-process| EC
    EC -.->|demand list| F
    EC -.->|runs read-only query| L
  end
  subgraph cloud["LeanSignal — public, 443"]
    API["lean-api"]
    VM[("Central Dataplane VM<br/>demanded, long retention")]
    UI["Web UI"]
  end
  EC ==>|gRPC control stream: index up, demands down, queries both ways| API
  F ==>|remote-write demanded subset via vmauth| VM
  UI -->|edit-mode query| API
  API -.->|view-mode read| VM
  • 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.

See docs/architecture.md for the full design.

Quick start

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=…).

helm upgrade --install leansignal-agent \
  oci://ghcr.io/leansignal/charts/leansignal-agent \
  --namespace leansignal --create-namespace \
  --set leansignal.tenant="YOUR_TENANT" \
  --set leansignal.agentKey.value="YOUR_KEY" \
  --set victoria-metrics-single.enabled=true

See docs/install-kubernetes.md.

Linux / macOS
curl -fsSL https://raw.githubusercontent.com/LeanSignal/leansignal-agent/main/scripts/install/install.sh \
  | sudo bash -s -- --agent-key YOUR_KEY --tenant YOUR_TENANT

Installs the agent + local VictoriaMetrics and registers them as services (systemd / launchd). See docs/install-linux.md and docs/install-macos.md.

Windows (PowerShell, as Administrator)
.\install.ps1 -AgentKey YOUR_KEY -Tenant YOUR_TENANT

See docs/install-windows.md.

Docker (trial)
export LEANSIGNAL_ENDPOINT=... LEANSIGNAL_AGENT_KEY=... LEANSIGNAL_DATAPLANE_ENDPOINT=...
docker compose -f deploy/docker/docker-compose.yaml up

Documentation

Full docs live in docs/:

The agent is configured with a standard OpenTelemetry Collector config file; see config/agent-config.example.yaml.

Building & running from source

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)

make build / make snapshot produce the release artifacts (all platforms). The distribution is assembled by the OpenTelemetry Collector Builder from manifest.yaml; first-party code lives under components/. See the development guide for the full local/cloud run loop.

Contributing & support

License

Apache 2.0 — see LICENSE and NOTICE. Bundles OpenTelemetry Collector and VictoriaMetrics (both Apache 2.0).

Directories

Path Synopsis
components
demandfilter
leansignaldemandfilter/factory.go
leansignaldemandfilter/factory.go
edgecontroller
leansignaledgecontroller/config.go
leansignaledgecontroller/config.go
metricstracker
leansignalmetricstracker/collector_timeseries.go
leansignalmetricstracker/collector_timeseries.go
proto module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL