|
| 1 | +{ |
| 2 | + "title": "PostgreSQL __CLUSTER_NAME__", |
| 3 | + "uid": "pg-__CLUSTER_NAME__", |
| 4 | + "schemaVersion": 39, |
| 5 | + "version": 1, |
| 6 | + "refresh": "30s", |
| 7 | + "timezone": "browser", |
| 8 | + "tags": ["postgresql", "cnpg", "pgbouncer"], |
| 9 | + "editable": true, |
| 10 | + "graphTooltip": 0, |
| 11 | + "panels": [ |
| 12 | + { |
| 13 | + "id": 1, |
| 14 | + "type": "stat", |
| 15 | + "title": "PostgreSQL Instances", |
| 16 | + "gridPos": { "x": 0, "y": 0, "w": 6, "h": 4 }, |
| 17 | + "targets": [ |
| 18 | + { |
| 19 | + "expr": "count(max by (pod) (cnpg_pg_postmaster_start_time_seconds{namespace=\"__NAMESPACE__\",service=\"__POSTGRES_SERVICE__\"}))", |
| 20 | + "refId": "A" |
| 21 | + } |
| 22 | + ], |
| 23 | + "options": { |
| 24 | + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, |
| 25 | + "orientation": "horizontal", |
| 26 | + "textMode": "value" |
| 27 | + } |
| 28 | + }, |
| 29 | + { |
| 30 | + "id": 2, |
| 31 | + "type": "stat", |
| 32 | + "title": "RW PgBouncer Pods Up", |
| 33 | + "gridPos": { "x": 6, "y": 0, "w": 6, "h": 4 }, |
| 34 | + "targets": [ |
| 35 | + { |
| 36 | + "expr": "round(sum(max by (pod) (cnpg_pgbouncer_up{namespace=\"__NAMESPACE__\",service=\"__RW_POOLER_SERVICE__\"})))", |
| 37 | + "refId": "A" |
| 38 | + } |
| 39 | + ], |
| 40 | + "options": { |
| 41 | + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, |
| 42 | + "orientation": "horizontal", |
| 43 | + "textMode": "value" |
| 44 | + } |
| 45 | + }, |
| 46 | + { |
| 47 | + "id": 3, |
| 48 | + "type": "stat", |
| 49 | + "title": "RO PgBouncer Pods Up", |
| 50 | + "gridPos": { "x": 12, "y": 0, "w": 6, "h": 4 }, |
| 51 | + "targets": [ |
| 52 | + { |
| 53 | + "expr": "round(sum(max by (pod) (cnpg_pgbouncer_up{namespace=\"__NAMESPACE__\",service=\"__RO_POOLER_SERVICE__\"})))", |
| 54 | + "refId": "A" |
| 55 | + } |
| 56 | + ], |
| 57 | + "options": { |
| 58 | + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, |
| 59 | + "orientation": "horizontal", |
| 60 | + "textMode": "value" |
| 61 | + } |
| 62 | + }, |
| 63 | + { |
| 64 | + "id": 4, |
| 65 | + "type": "stat", |
| 66 | + "title": "Total Database Size", |
| 67 | + "gridPos": { "x": 18, "y": 0, "w": 6, "h": 4 }, |
| 68 | + "targets": [ |
| 69 | + { |
| 70 | + "expr": "sum(max by (datname) (cnpg_pg_database_size_bytes{namespace=\"__NAMESPACE__\",service=\"__POSTGRES_SERVICE__\"}))", |
| 71 | + "refId": "A" |
| 72 | + } |
| 73 | + ], |
| 74 | + "fieldConfig": { |
| 75 | + "defaults": { |
| 76 | + "unit": "bytes" |
| 77 | + } |
| 78 | + }, |
| 79 | + "options": { |
| 80 | + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, |
| 81 | + "orientation": "horizontal", |
| 82 | + "textMode": "value" |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "id": 5, |
| 87 | + "type": "timeseries", |
| 88 | + "title": "WAL Files by Pod", |
| 89 | + "gridPos": { "x": 0, "y": 4, "w": 8, "h": 8 }, |
| 90 | + "targets": [ |
| 91 | + { |
| 92 | + "expr": "round(max by (pod) (cnpg_pg_wal_files_total{namespace=\"__NAMESPACE__\",service=\"__POSTGRES_SERVICE__\"}))", |
| 93 | + "legendFormat": "{{pod}}", |
| 94 | + "refId": "A" |
| 95 | + } |
| 96 | + ] |
| 97 | + }, |
| 98 | + { |
| 99 | + "id": 6, |
| 100 | + "type": "timeseries", |
| 101 | + "title": "Archived WAL Rate by Pod", |
| 102 | + "gridPos": { "x": 8, "y": 4, "w": 8, "h": 8 }, |
| 103 | + "targets": [ |
| 104 | + { |
| 105 | + "expr": "max by (pod) (rate(cnpg_pg_stat_archiver_archived_count{namespace=\"__NAMESPACE__\",service=\"__POSTGRES_SERVICE__\"}[5m]))", |
| 106 | + "legendFormat": "{{pod}}", |
| 107 | + "refId": "A" |
| 108 | + } |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "id": 7, |
| 113 | + "type": "timeseries", |
| 114 | + "title": "PgBouncer Active Clients", |
| 115 | + "gridPos": { "x": 16, "y": 4, "w": 8, "h": 8 }, |
| 116 | + "targets": [ |
| 117 | + { |
| 118 | + "expr": "round(sum(cnpg_pgbouncer_pools_cl_active{namespace=\"__NAMESPACE__\",service=\"__RW_POOLER_SERVICE__\"}))", |
| 119 | + "legendFormat": "rw", |
| 120 | + "refId": "A" |
| 121 | + }, |
| 122 | + { |
| 123 | + "expr": "round(sum(cnpg_pgbouncer_pools_cl_active{namespace=\"__NAMESPACE__\",service=\"__RO_POOLER_SERVICE__\"}))", |
| 124 | + "legendFormat": "ro", |
| 125 | + "refId": "B" |
| 126 | + } |
| 127 | + ] |
| 128 | + } |
| 129 | + ], |
| 130 | + "templating": { |
| 131 | + "list": [] |
| 132 | + }, |
| 133 | + "annotations": { |
| 134 | + "list": [] |
| 135 | + } |
| 136 | +} |
0 commit comments