Skip to content

Metrics and alerts

lowtide gives you three views of a cluster: the console, Prometheus metrics from each pod, and logs in Cloud Logging. This page covers what to watch and what to alert on. Every metric is listed in the metrics reference.

The runbooks use kubectl. With the Terraform module, the GKE cluster is named lowtide-<cluster_name> and the release runs in the namespace lowtide:

Terminal window
gcloud container clusters get-credentials lowtide-orders-prod --region europe-west1 --project acme-lowtide-prod
kubectl -n lowtide get pods -o wide

If your network can’t reach the cluster’s control plane and the cluster is registered in a fleet (clusters lowtide sets up always are), go through the Connect gateway:

Terminal window
gcloud container fleet memberships get-credentials lowtide-orders-prod --project acme-lowtide-prod

The examples on these pages use zones us-central1-a and us-central1-b, so pods are named lowtide-us-central1-a-0 and their WAL volumes wal-lowtide-us-central1-a-0.

The cluster page shows each pod’s zone and readiness, publish and delivery rates, and every subscription’s backlog and oldest unacknowledged message, from the agent’s heartbeat every 30 seconds. A cluster shows:

Status Meaning
Healthy Every pod ready, no upload errors, no failed WAL
Degraded A pod is not ready, segment uploads fail, or a WAL has failed. The console names the pod and what to check.
Offline No heartbeat for 5 minutes. The agent or the cluster’s outbound access is down. Message traffic may be fine. Check the pods directly.

Each gateway pod serves Prometheus metrics on port 9090 at /metrics. Counters reset when a pod restarts. On clusters from the Terraform module, GKE Managed Prometheus scrapes them (PodMonitoring), and you can query them with PromQL in Cloud Monitoring and use them in alerting policies. With the Helm chart, turn on podMonitoring.enabled or serviceMonitor.enabled.

The signals that matter most:

Signal Metric Normal
Backlog lowtide_subscription_backlog_messages, lowtide_subscription_oldest_unacked_age_seconds Depends on your consumers. Alert on age, as you would on Pub/Sub.
Uploads waiting lowtide_pending_upload_bytes A few seconds of traffic
Upload failures lowtide_upload_errors_total Not increasing
WAL failed lowtide_wal_failed 0
Publish health lowtide_publish_requests_total against lowtide_messages_published_total Both rising together. Requests rising while messages stay flat means publishes fail.
Delivery health lowtide_messages_redelivered_total, lowtide_ack_deadline_expired_total, lowtide_messages_dead_lettered_total Low compared with delivered
Licence lowtide_licence_state{state="valid"} 1
WAL disk use kubelet_volume_stats_used_bytes{persistentvolumeclaim=~"wal-.*"} (from the kubelet) Low; the WAL holds only what is not uploaded yet

The per-subscription backlog is reported by the pod that serves each shard, so sum it over pods. Take the maximum of the oldest-unacknowledged age.

Alert Condition Runbook
Subscription falling behind max by (subscription) (lowtide_subscription_oldest_unacked_age_seconds) above your limit for 5 minutes Backlog growth
Uploads stalled lowtide_pending_upload_bytes above 30 seconds of your publish rate for 5 minutes, or lowtide_upload_errors_total increasing for 5 minutes WAL disk full, Metadata store outage
WAL failed lowtide_wal_failed == 1 WAL disk full
WAL disk filling WAL volume above 50 % WAL disk full
Memory Container memory above 80 % of its limit WAL disk full
Publishes failing rate(lowtide_publish_requests_total[5m]) > 0 and rate(lowtide_messages_published_total[5m]) == 0 WAL disk full
Pods not ready Fewer ready pods than expected in a zone Zone failure
During a migration: mirror parked lowtide_mirror_parked == 1 Mirroring
During a migration: mirror lag max by (topic) (lowtide_mirror_lag_seconds) > 60 for 5 minutes Mirroring
  • /healthz returns 200 while the process runs, and 500 once the WAL has failed, so the liveness probe restarts such a pod. It does not reflect Cloud Storage or database health.
  • /readyz returns 200 once the gateway serves (after connecting to the database, registering its stream and recovering its WAL), and 503 as soon as shutdown starts or the WAL fails.

Gateways log JSON to standard output, so on GKE the lines are in Cloud Logging.

Message Meaning
segment upload failed; retrying Uploading a WAL file failed. error says whether Cloud Storage or the database (indexing segment) failed.
WAL write/fsync failed; WAL is now read-only, WAL rotation failed The pod refuses every publish until it restarts.
recovered WAL file, WAL tail is not intact; truncating Recovery at startup.
waiting for postgres Startup can’t reach the database. It gives up after 30 attempts.
lease renewal failed, cursor checkpoint failed, polling stream heads Database errors on the delivery path.
subscription ownership lost; reconnect Another pod took over a shard.
reading stream, reading remote stream A subscription can’t read a segment (Cloud Storage or index error).
Pub/Sub mirror parked, Pub/Sub mirror: publish failed, retrying A topic mirror can’t publish to Pub/Sub.

For a closer look, connect to the metadata database through the Cloud SQL Auth Proxy from a pod in the VPC, as the built-in admin user (lowtide_admin, password in the lowtide-db-admin Secret). A few read-only queries:

-- Who serves a subscription's shards (owner = the pod's address).
SELECT key, owner, expires_at FROM lt_leases WHERE key LIKE 'sub/projects/P/subscriptions/S/%';
-- Writer streams: name (= pod), zone, address.
SELECT num, name, zone, addr FROM lt_streams ORDER BY num;

Don’t change rows by hand.