| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- {
- "uid": "briven-postgres-health",
- "title": "postgres · health",
- "tags": ["briven", "postgres"],
- "timezone": "browser",
- "schemaVersion": 39,
- "refresh": "30s",
- "time": { "from": "now-1h", "to": "now" },
- "panels": [
- {
- "id": 1,
- "title": "active connections",
- "type": "timeseries",
- "datasource": { "type": "prometheus", "uid": "Prometheus" },
- "gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
- "targets": [
- {
- "expr": "pg_stat_activity_count",
- "legendFormat": "{{datname}}"
- }
- ]
- },
- {
- "id": 2,
- "title": "transactions / second",
- "type": "timeseries",
- "datasource": { "type": "prometheus", "uid": "Prometheus" },
- "gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 },
- "targets": [
- {
- "expr": "rate(pg_stat_database_xact_commit[1m])",
- "legendFormat": "commits / {{datname}}"
- },
- {
- "expr": "rate(pg_stat_database_xact_rollback[1m])",
- "legendFormat": "rollbacks / {{datname}}"
- }
- ]
- },
- {
- "id": 3,
- "title": "deadlocks (last 1h)",
- "type": "stat",
- "datasource": { "type": "prometheus", "uid": "Prometheus" },
- "gridPos": { "x": 0, "y": 8, "w": 6, "h": 4 },
- "targets": [
- {
- "expr": "sum(increase(pg_stat_database_deadlocks[1h]))"
- }
- ]
- },
- {
- "id": 4,
- "title": "longest running query (s)",
- "type": "stat",
- "datasource": { "type": "prometheus", "uid": "Prometheus" },
- "gridPos": { "x": 6, "y": 8, "w": 6, "h": 4 },
- "targets": [
- {
- "expr": "max(pg_stat_activity_max_tx_duration)"
- }
- ],
- "fieldConfig": {
- "defaults": {
- "unit": "s",
- "thresholds": {
- "steps": [
- { "value": 0, "color": "green" },
- { "value": 30, "color": "yellow" },
- { "value": 120, "color": "red" }
- ]
- }
- }
- }
- },
- {
- "id": 5,
- "title": "database size (per project schema)",
- "type": "timeseries",
- "datasource": { "type": "prometheus", "uid": "Prometheus" },
- "gridPos": { "x": 12, "y": 8, "w": 12, "h": 4 },
- "targets": [
- {
- "expr": "pg_database_size_bytes",
- "legendFormat": "{{datname}}"
- }
- ],
- "fieldConfig": {
- "defaults": { "unit": "bytes" }
- }
- }
- ]
- }
|