Docs

Architecture

Fleetscope is one Go process with PostgreSQL. It reads the metrics in Mimir and the logs in Loki, decides what is wrong, and tells the people who own it. It installs nothing in the clusters or on the servers it watches.

flowchart LR
  subgraph Telemetry["Your telemetry stack"]
    M[(Mimir<br/>PromQL)]
    L[(Loki<br/>LogQL)]
    G[Grafana]
  end
  subgraph FS["Fleetscope (one pod)"]
    W[Rule worker<br/>every 15 s] --> FI[(Findings)]
    FI --> D[Dispatcher]
    API[API + web UI]
  end
  PG[(PostgreSQL)]
  W -- query --> M
  W -- query --> L
  FS --- PG
  D --> TG[Telegram]
  D --> SL[Slack]
  D --> GC[Google Chat]
  API -. links .-> G
  U((People)) --> API

Parts

Part What it does
API and web UI A React single-page app embedded in the binary, and a JSON API under /api/v1. Sessions are cookies with CSRF protection; sign-in is a password, Google or Keycloak (OpenID Connect).
Rule worker Every 15 seconds it takes the rules that are due (each has its own interval, 15 s to 1 h), asks Mimir or Loki, and compares every series with the thresholds. Several replicas share the work through the database.
Findings One row per series that crosses a threshold: an alert. A finding opens after the rule's wait, keeps its level within the hysteresis, and closes on its own when the series is back to normal.
Dispatcher Every 15 seconds it sends what changed to the channels: new alerts, recoveries, reminders, a log excerpt, and a daily summary. It groups, threads and edits messages so one incident stays one conversation.
PostgreSQL Rules and their versions, findings, channels, the history of the messages, silences, members, the audit log. Every table of an organisation has its org_id under row-level security.

The telemetry itself never leaves Mimir and Loki: Fleetscope keeps the numbers of an alert and, for a pod, a short excerpt of its log lines in the message, nothing else.

Following one alert

  1. Ask. A rule Disk almost full asks Mimir its PromQL once a minute. Each series in the answer is one candidate, such as {cluster="prod", node="node-a", device="/dev/sda1"}.
  2. Judge. The value is compared with Warning and Critical. A series past a threshold for longer than the rule's wait opens a finding; one that comes back past the threshold by more than the hysteresis closes it.
  3. Link. When a node and three pods on it open in the same minutes, the pods hang under the node: the node is the parent, and the four alerts are one incident.
  4. Tell. The dispatcher sends the node to the channel of its kind (or the channels picked on the rule). The pods do not ring again: the node's Telegram message is edited to list them. A recovery is a reply in the same thread.
  5. Remind and summarise. A Critical alert still open is sent again after 15 minutes, 1 hour, 6 hours, then every 24 hours; the daily summary lists what is still open.

Watching Fleetscope itself

  • A rule that cannot be read for 10 minutes opens FS-001; a whole tenant of Mimir or Loki that stops answering opens FS-002, so an alert never goes silent unnoticed.
  • heartbeat.url makes the server call an outside service (Healthchecks.io, Uptime Kuma) every minute while the rules and the dispatcher run. When the calls stop, that service alerts: Fleetscope cannot tell that it stopped itself.
  • A channel that keeps failing shows on top of the Findings page, and a backup channel receives what it could not send.

Data and security

What Where How long
Rules, channels, silences, members PostgreSQL Until deleted
Findings PostgreSQL Open ones, and closed ones for a while for the history
Messages sent PostgreSQL For the history on the Notifications page
Audit log PostgreSQL 90 days
Tokens of Mimir, Loki, channels PostgreSQL, AES-GCM encrypted Until changed
Client secrets of Google and Keycloak Kubernetes Secrets Managed by you

Addresses of Mimir, Loki and the channels are checked against SSRF: loopback and link-local addresses (the metadata server) are refused.