Skip to content

Observability

Every node checks its own health every 30 seconds and reports failing checks and active alerts. Until you’ve enrolled a user device, pass --as-operator to node API commands (node status, node services, node logs).

Terminal window
anastroctl node status # health, version, API health, git rev, and active alerts
anastroctl node services # every service on each node and its state

Filter to specific nodes with -n <node> (repeatable). node status exits non-zero if any node is unhealthy.

Because node status talks to each node’s own machined API, it still works when apid or Postgres is down. A node is unhealthy if any enabled service isn’t active or if any of these checks fail (the same gate upgrades wait on):

Check Fails when
secrets Node is sealed (missing a secret referenced by its config)
starting Services haven’t finished starting yet
etcd-member etcd sees no leader (3 or 5 nodes)
postgres-replication Postgres is neither leading nor replicating closely (3 or 5 nodes)
secure-boot [node.boot] secure_boot = true, but booted without Secure Boot
image-security Production image lacks its signed PCR 11 epoch policy or /var isn’t bound to PCR 7 + PCR 11

The API column checks whether apid is reachable and talking to Postgres (a dash means it wasn’t checked or wasn’t reachable, such as when calling with --as-operator). Alerts show alongside health without marking a node unhealthy.

Drill down into specific subsystems:

Terminal window
anastroctl cluster postgres status # members, primary, replication lag
anastroctl cluster backup status # base backups and WAL archiving
anastroctl cluster etcd members
anastroctl cluster host list # workers and machine resource usage
anastroctl cluster fs status # workspace GC state
anastroctl node list # registered control-plane nodes
Terminal window
anastroctl node logs -n cp1 apid # last 100 lines
anastroctl node logs -n cp1 postgres -f # stream live
anastroctl node logs -n cp1 schedd --lines 1000
anastroctl node restart -n cp1 apid

Service names match anastroctl node services: apid, schedd, postgres (Patroni on HA clusters), etcd, relay, agents, secretd, keyd, opd, hostagent, dwfsd, egress (Package firewall), and postgres-other during a Postgres major upgrade.

Cluster-wide alerts are evaluated by the Postgres primary (which also logs each raise/clear event); node-local alerts come from each node. All active alerts appear in anastroctl node status.

Alert Fires when
BackupsDisabled Backups are turned off
BaseBackupMissed No base backup exists, or the scheduled one is >1 hour overdue
WalArchiveStalled WAL archiving has failed for 5 minutes
BackupVerifyFailed Latest automated backup verification failed
ReplicationLagHigh A Postgres replica is >16 MiB behind
EtcdQuorumAtRisk Losing one more etcd member will break quorum
PostgresNoPrimary No Postgres primary is elected
KeyProviderUnavailable keyd is down or missing keys while filesystem is enabled
SecretStoreUnavailable secretd is down on a node holding secrets/kek
TunnelDown Cloudflare Tunnel is enabled, but cloudflared isn’t connected
TunnelStopped Watchdog stopped cloudflared because hooks /healthz failed (other connectors carry traffic)
CertExpiringSoon A certificate the node depends on ends within 30 days, or has ended: the image’s Secure Boot certificate (past it, the node admits no upgrade), or on HA control-plane nodes etcd’s peer certificate or CA
StoreUnreachable A store in use (backup.store, filesystem.store, pidurable.payload_store) doesn’t answer the primary within 10 seconds; checked every 5 minutes
GcStalled Filesystem GC hasn’t finished a pass for an hour past its scheduled time, or the last pass reported errors
PortabilityLagHigh A machine’s workspace has a snapshot that hasn’t reached the store for over 15 minutes: if its host were lost, the machine would resume that far back

For CertExpiringSoon on etcd’s peer certificate, run anastroctl cluster bundle renew-etcd, then anastroctl cluster unseal; for etcd’s CA, roll it over with anastroctl cluster bundle etcd-ca prepare, activate and finish, unsealing every node after each. For StoreUnreachable, run anastroctl cluster storage test <store> to see which operation fails. For GcStalled, anastroctl cluster fs gc shows the last pass and --now runs another. For PortabilityLagHigh, the host’s dwfsd logs say why its uploads are behind: usually a slow uplink after large writes, or a store that refuses them. A planned move or drain never loses that work; only a lost host does.

Configure an OTLP/HTTP endpoint in anastro.toml (applies live across control-plane and worker-only nodes):

[observability]
otlp_endpoint = "https://otel.example.com:4318"
otlp_headers = { authorization = "secret:observability/otlp_token" }
Terminal window
printf 'Bearer %s' "$TOKEN" | anastroctl cluster bundle set observability/otlp_token
anastroctl cluster unseal
anastroctl cluster apply

After each 30-second check cycle, every node pushes JSON OTLP metrics to <otlp_endpoint>/v1/metrics and alert raise/clear logs (anastro.alert.raised, anastro.alert.cleared) to <otlp_endpoint>/v1/logs.

Resource attributes include service.name = "anastro-machined", host.name, anastro.node.name, anastro.cluster.name, anastro.cluster.id, and service.version. Exported metrics include:

Metric Meaning
anastro.node.healthy, anastro.node.failing{check} Same status shown by node status
anastro.node.sealed 1 while sealed
anastro.alert.active{alert} 1 while the alert is firing
anastro.postgres.primary, anastro.postgres.replica_lag_bytes Primary status and replica lag
anastro.backup.wal_archive_age_seconds, anastro.backup.base_backup_age_seconds Backup freshness
anastro.postgres.database_size_bytes, anastro.postgres.xid_headroom, anastro.postgres.backends Built-in Postgres stats (no separate exporter needed)