Skip to main content

Alerts and Runbooks

These are the alerts in the Zerq observability stack (deploy/observability/prometheus/rules/zerq-alerts.yml, also shipped as a Kubernetes PrometheusRule). Each alert's runbook_url points to its section below. Thresholds are starting points; tune them to your traffic.

AlertSeverityFires when
ZerqBackendDowncriticalA backend instance cannot be scraped for 2 minutes.
ZerqGatewayHighErrorRatecriticalMore than 5% 5xx responses on a collection for 5 minutes.
ZerqErrorBudgetFastBurncriticalThe 99.9% error budget burns at 14.4x or more (1h and 5m).
ZerqErrorBudgetSlowBurnwarningThe budget burns at 6x or more (6h and 30m).
ZerqGatewayHighLatencywarningA route's p95 latency is above 1s for 10 minutes.
ZerqUpstreamFailureswarningUpstream calls of a route fail (unreachable, timeout, credentials).
ZerqAuthFailureSpikewarningMore than 1 request/s rejected with 401/403 for 10 minutes.
ZerqThrottlingHighwarningMore than 10% of a collection's requests get 429 for 10 minutes.
ZerqRequestLogWriteFailureswarningRequest or audit log entries could not be stored.
ZerqLogStreamLosingRecordswarningStreamed log records failed or were dropped.
ZerqAIProviderErrorswarningMore than 5% of a model's AI requests fail at the providers for 5 minutes.
ZerqAIProviderFailingwarningMore than half of the calls to one AI provider fail for 5 minutes, even when fallbacks recover the requests.
ZerqWorkflowFailureswarningMore than 10% of a trigger's workflow runs fail for 5 minutes.
ZerqMongoPoolSaturatedwarningMore than 90% of MongoDB connections busy for 10 minutes.
ZerqMongoCheckoutFailureswarningRequests could not get a MongoDB connection.
ZerqMongoSlowCommandswarningA MongoDB command's p95 is above 250ms for 10 minutes.
ZerqRedisPoolTimeoutswarningCallers timed out waiting for a Redis connection.
ZerqHighMemorywarningResident memory above 2 GB for 15 minutes.
ZerqGoroutinesHighwarningMore than 20000 goroutines for 15 minutes.
ZerqTrafficSpikewarningA collection's traffic is more than 4 standard deviations above its last-day average for 10 minutes.
ZerqTrafficDropwarningA collection's traffic is more than 3 standard deviations below its last-day average for 15 minutes.
ZerqSyntheticProbeFailingcriticalA synthetic check (blackbox exporter) fails for 3 minutes.

Alerts in the console​

The console's Alerts page (next to Dashboard, for the viewer role) lists the alerts Alertmanager holds for Zerq: firing alerts first (critical, then warning), then silenced and inhibited ones, each with its summary, description, labels, how long it has fired and a link to its runbook below. The navigation shows the number of firing alerts, red when one of them is critical. The page refreshes every 30 seconds.

Connect it on the backend:

ALERTMANAGER_URL=http://alertmanager:9093          # the backend reads GET /api/v2/alerts
ALERTMANAGER_EXTERNAL_URL=https://alertmanager.example.com # optional: "Silence in Alertmanager" links
ALERTMANAGER_TOKEN=... # optional bearer token; or user:password@ in the URL
ALERTMANAGER_FILTER='alertname=~"Zerq.*"' # default: only the Zerq rules

The backend asks Alertmanager at most every 10 seconds, however many consoles are open. Silence in Alertmanager opens Alertmanager's silence form with the alert's labels filled in; silences are created there, not in Zerq. When Alertmanager cannot be reached the page says so and GET /api/v1/alerts returns 502; the address and credentials are never returned or logged. Without ALERTMANAGER_URL the page explains how to connect it. The development stack (deploy/docker-compose.dev.yml) points at the Alertmanager of the observability stack.

Thresholds​

The availability SLO counts 5xx responses as errors; 4xx responses are the caller's errors and have their own alerts. To use a different objective, change 0.001 (the 99.9% budget) in the two burn-rate alerts.

The SLOs and Error Budgets dashboard and the burn-rate alerts answer different questions. The dashboard shows how much budget is left over the time range and objective you pick. An alert fires only while both of its windows burn above the threshold: the 1h and 5m windows for the fast burn, the 6h and 30m windows for the slow burn. A dashboard that shows an exhausted budget with no alert firing means the errors happened earlier in the range and have stopped.

ZerqBackendDown​

Prometheus cannot reach the instance's metrics listener.

  1. Check the process or pod: kubectl -n zerq get pods, docker compose ps. Look for crash loops and OOM kills.
  2. Check /readyz on port 8080. A down MongoDB or Redis makes the instance unready.
  3. If the process runs, check that METRICS_ADDR is set and reachable from Prometheus (network policy, METRICS_TOKEN matching the scrape config).

ZerqGatewayHighErrorRate​

The gateway or its upstreams return 5xx.

  1. Open Zerq — API Gateway, filter by the collection and find the route in the Routes table.
  2. Compare Upstream failures with 5xx by route: 502 with upstream failures means the upstream is unreachable or its credentials cannot be applied; other 5xx come from the upstream itself.
  3. Click a point in Latency percentiles (exemplar) or filter Request Logs by status to see the error and open the trace.
  4. Check the audit log for configuration changes in the same window (proxy, collection, credential). Roll back if one matches.

ZerqErrorBudgetFastBurn​

At this rate the monthly 99.9% budget is gone in about two days. Treat it like an outage: follow ZerqGatewayHighErrorRate, and mitigate with the smallest change (unpublish or roll back the failing proxy, switch the collection's endpoint, roll back a release).

ZerqErrorBudgetSlowBurn​

A low but steady error rate will exhaust the budget in about five days. It usually points to one route or one upstream. Use the SLOs and Error Budgets dashboard to find the collection and the API Gateway routes table to find the route, then fix it during working hours.

ZerqGatewayHighLatency​

  1. On Zerq — API Gateway, compare Upstream latency p95 by route with Gateway overhead. If upstream latency is high, the upstream is slow; talk to its owners or add caching.
  2. If the gateway overhead is high, check workflows, transformations and policies on the route, and Zerq — Runtime & Dependencies for CPU, GC and MongoDB latency.
  3. Open a slow trace from an exemplar or from Slowest recent gateway requests on Zerq — Logs & Traces.

ZerqUpstreamFailures​

The gateway cannot complete the upstream call: connection refused, DNS, TLS, timeout, or upstream credentials that cannot be loaded or applied (expired certificate, OAuth token endpoint failing). Callers get 502.

  1. Read the Error field of a matching request log entry: it holds the sanitised cause.
  2. Check the collection's endpoint and the upstream's health from the gateway's network.
  3. For credential errors, check the credential on the proxy or collection (see Runtime Auth Application).

ZerqAuthFailureSpike​

Many requests are rejected with 401 or 403. Common causes: a client using an expired or rotated token, a profile changed or deactivated, a wrong X-Client-ID/X-Profile-ID, or credential stuffing. Filter Request Logs by status 401/403 and look at client IPs and the Error field; check the audit log for recent profile changes. Rejected requests are counted under client_id="unauthenticated".

ZerqThrottlingHigh​

Rate limits or quotas refuse more than 10% of a collection's requests. Find the clients in Top clients, compare with their policy limits, and decide whether the traffic is expected (raise the limit) or abusive (keep or tighten it).

ZerqRequestLogWriteFailures​

Request or audit log entries could not be written to MongoDB, so they are missing from the console. Check MongoDB health, disk space and the backend logs (Error logging request / Failed to create audit log). Streamed copies are not affected.

ZerqLogStreamLosingRecords​

Records to a log stream destination failed after retries (result="failed") or were dropped because the in-memory queue was full (sink="queue"). Check the destination (collector, Splunk HEC, webhook) and its credentials in the backend logs (Log stream ...: N records not delivered). Raise LOG_STREAM_QUEUE_SIZE for short outages.

ZerqAIProviderErrors​

The model's providers were unavailable or timed out after all fallbacks (outcome upstream_unavailable, upstream_timeout or gateway_unavailable). Client-side outcomes (guardrail blocks, budgets, a client's own AI rate limit, unknown models) do not count; provider rate limiting shows in ZerqAIProviderFailing.

  1. On Zerq — AI Gateway, check Provider-side failures and Failed AI requests: the AI log entry's attempts show each provider's status and error.
  2. Check the provider's status page, its credential in AI Gateway › Providers, and provider health checks.
  3. Add or enable a fallback deployment or model for the affected model, or move traffic to another provider.

ZerqAIProviderFailing​

Calls to one provider fail (connection errors, timeouts, 4xx/5xx including 429) on more than half of its attempts (zerq_ai_provider_attempts_total). Fallbacks may still serve the requests, so callers may not notice, but every request pays for the failed attempt in latency, and the next outage of the fallback provider is not covered.

  1. On Zerq — AI Gateway, check Provider attempts by result and Provider call p95; in the console, AI Gateway › Overview › Providers shows the same per provider.
  2. Open a recent AI log entry that tried the provider: its attempts show the status and error of each call.
  3. Check the provider's status page, its credential and base URL in AI Gateway › Providers, and turn on health checks so the router stops sending traffic to it while it is down.

ZerqWorkflowFailures​

Workflow runs started by the trigger fail (http_trigger for gateway workflows; cron_trigger, kafka_consumer, imap_trigger for background workflows).

  1. On Zerq — Workflows & MCP, find the failing node type in Node failures by node type.
  2. Open a failed run from Failed requests on Zerq — Logs & Traces (or search Tempo for {status=error && name=~"workflow.*"}): the failed node's span has the error.
  3. Check what the node depends on (an HTTP endpoint, a database, credentials) and recent changes to the workflow in the audit log.

ZerqMongoPoolSaturated​

Almost every MongoDB connection is busy. Look at Command latency p95 on Zerq — Runtime & Dependencies: slow commands hold connections longer. Raise DB_MAX_POOL_SIZE if MongoDB has headroom, otherwise scale MongoDB or find the slow queries.

ZerqMongoCheckoutFailures​

Requests failed because no MongoDB connection could be obtained in time. It follows pool saturation or MongoDB being unreachable; see ZerqMongoPoolSaturated and check MongoDB availability.

ZerqMongoSlowCommands​

Check MongoDB's own metrics (CPU, disk, replication lag), missing indexes (db.collection.explain()), and the network between the backend and MongoDB.

ZerqRedisPoolTimeouts​

Callers waited too long for a Redis/KeyDB connection. Check Redis latency and CPU and the network. Rate limits, response cache and idempotency depend on Redis.

ZerqHighMemory​

Compare memory with traffic, goroutines and in-flight requests. Large request or response bodies, long-lived streams and big response caches raise memory. Set a container memory limit that fits your sizing and consider REQUEST_LOG_MAX_BODY_BYTES.

ZerqGoroutinesHigh​

Many concurrent streams (SSE), slow upstreams holding requests, or a leak. Compare with Requests in flight and upstream latency. If goroutines keep growing while traffic is flat, collect a goroutine dump (send SIGQUIT to the process in a non-production environment) and report it.

ZerqTrafficSpike​

Traffic anomaly detection compares each collection's request rate with its own average and standard deviation over the last day (recording rules zerq:gateway_requests:avg1d, stddev1d and zscore; the standard deviation is at least 10% of the average). A spike is often a client retrying in a loop, a load test, a new integration going live, or abuse. Use Top clients and Rejected requests on Zerq — API Gateway to find the source; rate limits on the client's policy contain it. The alert needs a day of history to be meaningful.

ZerqTrafficDrop​

Traffic fell far below its usual level. When clients cannot reach the gateway at all, the gateway's own error alerts stay quiet, so this alert catches problems in front of it: DNS, load balancer or ingress, expired TLS certificates, a client release that broke its integration. Check synthetic probes and the ingress, and confirm with the client owners. Expected quiet periods (weekends, holidays) can trigger it; silence it in Alertmanager for planned events.

ZerqSyntheticProbeFailing​

The blackbox exporter (Prometheus job zerq-synthetic) probes URLs from outside the backend: by default the backend's /readyz, and any gateway routes you add with a monitoring client (see deploy/observability/blackbox/blackbox.yml). Open the probe in Prometheus (probe_http_status_code, probe_duration_seconds) to see whether it timed out or got an error status, then follow ZerqBackendDown or ZerqGatewayHighErrorRate.