> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoring thresholds

> Warning and critical alerting thresholds per infrastructure service for a self-hosted Prisme.ai.

Reference thresholds for the per-service alerting required by [Production Readiness](./requirements) (M1 to M7). Adapt the exact values to your capacity and criticality, but keep the two levels: **warning** (working hours) and **critical** (24/7 when the application is critical).

## PostgreSQL / MongoDB

| Metric                                          | Warning                   | Critical                                |
| ----------------------------------------------- | ------------------------- | --------------------------------------- |
| Availability (health check)                     | -                         | failure > 1 min                         |
| No primary (Mongo) / standby unavailable (PG)   | -                         | > 30 s                                  |
| Replication lag                                 | > 30 s                    | > 5 min                                 |
| Connections used / max\_connections             | > 70%                     | > 85%                                   |
| `remaining connection slots are reserved` error | -                         | any occurrence                          |
| Sustained CPU                                   | > 70% for 15 min          | > 90% for 5 min                         |
| Available memory                                | \< 25%                    | \< 10%                                  |
| Disk used                                       | > 75%                     | > 85% or predicted saturation \< 7 days |
| IOPS / burst credits                            | > 80% consumed            | imminent exhaustion                     |
| Query latency p95                               | drift > 2x baseline       | -                                       |
| Long queries / transactions, deadlocks          | > 5 min / deadlock spikes | -                                       |
| Cache hit ratio (PG)                            | \< 95%                    | -                                       |
| Autovacuum behind / XID age (PG)                | > 1.0 billion             | > 1.5 billion                           |
| WiredTiger tickets available (Mongo)            | \< 30                     | \< 10                                   |
| Last successful backup                          | > 24 h                    | > 48 h or job failure                   |
| TLS certificate                                 | expiry \< 30 days         | expiry \< 7 days                        |
| PgBouncer clients waiting (cl\_waiting)         | > 0 for 1 min             | pool saturated persistently             |

## Redis

| Metric                                                  | Warning                    | Critical                    |
| ------------------------------------------------------- | -------------------------- | --------------------------- |
| Availability / PING                                     | -                          | failure > 30 s              |
| used\_memory / maxmemory                                | > 75%                      | > 90%                       |
| `OOM command not allowed` errors (noeviction instances) | -                          | any occurrence              |
| evicted\_keys on a noeviction instance                  | -                          | > 0 (misconfiguration)      |
| Connected clients / maxclients                          | > 70%                      | > 85%                       |
| blocked\_clients, rejected\_connections                 | > 0                        | sustained growth            |
| Command latency p99 / slowlog                           | > 10 ms                    | > 100 ms                    |
| Replication link broken / failover                      | -                          | any occurrence              |
| rdb\_last\_bgsave\_status / aof\_last\_write\_status    | -                          | err                         |
| Broker stream length (XLEN) vs maxLen                   | > 70%                      | > 90%                       |
| Consumer group lag (XPENDING)                           | continuous growth > 15 min | business threshold exceeded |
| Memory fragmentation (mem\_fragmentation\_ratio)        | > 1.5                      | > 2.0                       |

<Note>
  The broker's consumer group lag is the most useful leading indicator: events accumulate before users perceive anything.
</Note>

## Elasticsearch / OpenSearch

| Metric                                                                                         | Warning                          | Critical                           |
| ---------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------- |
| cluster.health.status                                                                          | yellow > 15 min                  | red (any occurrence)               |
| unassigned\_shards                                                                             | > 0                              | > 0 for 15 min                     |
| Shards per node                                                                                | > 800 (80% of the limit)         | > 950                              |
| JVM heap used                                                                                  | > 75%                            | > 85%                              |
| Old-gen GC pauses                                                                              | > 1 s cumulative per min         | increasing frequency               |
| Disk used                                                                                      | > 80% (before low watermark 85%) | > 88%; at 95% indices go read-only |
| Write / search threadpool rejections                                                           | > 0                              | sustained growth                   |
| Indexing / search latency p95                                                                  | drift > 2x baseline              | -                                  |
| Circuit breakers triggered                                                                     | > 0                              | sustained                          |
| Last snapshot failure / age                                                                    | > 24 h                           | > 48 h or failure                  |
| ILM errors / policies in error                                                                 | > 0                              | -                                  |
| `cleanup-*` CronJob failures                                                                   | 1 failure                        | 2 consecutive failures             |
| Mapping errors (`Limit of total fields`, `mapper_parsing_exception`) in `prismeai-events` logs | any occurrence                   | recurrence                         |
| Node loss / master quorum loss                                                                 | -                                | any occurrence                     |
| Disk iowait                                                                                    | > 10%                            | > 25%                              |

## Object storage

| Metric                                                      | Warning                              | Critical                        |
| ----------------------------------------------------------- | ------------------------------------ | ------------------------------- |
| 5xx error rate                                              | > 0.1%                               | > 1%                            |
| 403 / AccessDenied error rate                               | abnormal spike (expired credentials) | -                               |
| Request latency p95                                         | drift > 2x baseline                  | -                               |
| Cross-region replication lag / failure                      | > 1 h                                | > 6 h                           |
| Change to bucket policy, public access block, or versioning | -                                    | any occurrence (security alert) |
| Volume growth                                               | drift > 30% vs monthly forecast      | -                               |
| Age of last backup sync                                     | > 24 h                               | > 48 h                          |
| Provider request quotas / limits                            | > 80%                                | > 90%                           |

## RWX filesystem

| Metric                                                                    | Warning    | Critical    |
| ------------------------------------------------------------------------- | ---------- | ----------- |
| Space used                                                                | > 75%      | > 85%       |
| Inodes, burst credits / throughput (EFS), NFS latency, pod mount failures | to monitor | per runbook |

## References

<CardGroup cols={2}>
  <Card title="Production Readiness" icon="clipboard-check" href="./requirements">
    Requirements, responsibilities, and the go/no-go checklist
  </Card>

  <Card title="Scaling" icon="arrow-up-right-dots" href="/self-hosting/operations/scaling">
    Sizing, horizontal and vertical scaling, and load practices
  </Card>
</CardGroup>
