Audience: Operators (SREs, Platform Engineers, and On-Call Responders)
This guide explains how queue-related alerts fire in the Credence Backend, what they mean, and how operators should respond. The Credence Backend utilizes PostgreSQL connection pools and background workers for handling queued jobs.
For a high-level overview of observability, please see the Monitoring Overview.
Severity: SEV2 (Resource Exhaustion)
Routing: #prod-alerts (Slack) / Staging Tickets
This alert triggers when the API connection pool is saturated and incoming HTTP requests are queued waiting for a database connection for more than 2 minutes.
Prometheus Query:
pg_pool_waiting_count{job="credence-backend", pool="api"} > 0
⚠️ Production Alert - SEV2 Alert: PgPoolSaturation Service: database Summary: PostgreSQL connection pool saturated Description: API pool has 14 requests queued waiting for a connection for >2 minutes. Consider increasing DB_POOL_MAX or investigating slow queries.
- Identify slow queries: Check the Grafana dashboard for API endpoints with high p99 latency (
HighP99Latencyalert may also fire). - Check database locks: A long-running transaction may be blocking others. Query
pg_locksor review recent slow query logs. - Scale connection pools (Mitigation): If the database has adequate CPU/Memory, increase
DB_POOL_MAXin the.envconfiguration and restart the application pods.
Severity: SEV3 (Low Priority Ticket)
Routing: #prod-low-priority (Slack) / Staging Tickets
Background workers process queued jobs like bulk verifications. This alert fires when the worker pool exhausts its connections, causing background tasks to wait for a connection for more than 5 minutes.
Prometheus Query:
pg_pool_waiting_count{job="credence-backend", pool="worker"} > 0
📌 SEV3 - PgWorkerPoolSaturation Service: database Summary: Worker connection pool saturated Description: Worker pool has 5 jobs queued waiting for a connection for >5 minutes.
- Review worker job types: Identify if a specific background task (e.g., bulk identity verification) is stalled.
- Review application logs: Check for repetitive timeouts or retries from the worker processes.
- Scale worker pods: If CPU/RAM allows, scale up the worker deployments in Kubernetes to distribute the job queue over more nodes.
Severity: SEV3
Routing: #prod-maintenance (Slack, Ticket only, No Page)
This alert monitors the depth of asynchronous data exports. It fires when the number of queued export tasks grows too large, indicating that the workers processing the export queue are falling behind the enqueue rate.
📌 SEV3 - ExportQueueDepth Service: data-export Description: Export queue depth is currently 1500 tasks, exceeding the threshold. Processing latency may increase.
- Check consumer health: Verify that export worker pods are healthy and not repeatedly crashing (OOMKilled).
- Purge poison pills: Sometimes a specific export job crashes the worker. Check the dead-letter queue and quarantine malformed tasks.