My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: dashboard schema

+67 -149
+67 -148
modules/grafana-dashboard.json
··· 1 1 { 2 - "__inputs": [], 3 - "__requires": [], 4 2 "annotations": { "list": [] }, 5 3 "editable": true, 6 - "fiscalYearStartMonth": 0, 7 4 "graphTooltip": 1, 8 5 "id": null, 9 6 "links": [], ··· 12 9 { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, 13 10 "id": 100, "title": "System", "type": "row" }, 14 11 15 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 12 + { "datasource": "Prometheus", 16 13 "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 17 14 "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", 18 15 "steps": [{"color":"green","value":null},{"color":"yellow","value":70},{"color":"red","value":90}] }, 19 16 "unit": "percent" }, "overrides": [] }, 20 17 "gridPos": { "h": 6, "w": 4, "x": 0, "y": 1 }, 21 18 "id": 1, "options": { "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"] }, "showThresholdLabels": false, "showThresholdMarkers": true }, 22 - "title": "CPU Usage", 23 - "type": "gauge", 24 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 25 - "expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", 26 - "legendFormat": "CPU %", "refId": "A" }] }, 19 + "title": "CPU Usage", "type": "gauge", 20 + "targets": [{ "datasource": "Prometheus", "expr": "100 - (avg by(instance) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", "legendFormat": "CPU %", "refId": "A" }] }, 27 21 28 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 22 + { "datasource": "Prometheus", 29 23 "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 30 24 "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", 31 25 "steps": [{"color":"green","value":null},{"color":"yellow","value":75},{"color":"red","value":90}] }, 32 26 "unit": "percent" }, "overrides": [] }, 33 27 "gridPos": { "h": 6, "w": 4, "x": 4, "y": 1 }, 34 28 "id": 2, "options": { "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"] }, "showThresholdLabels": false, "showThresholdMarkers": true }, 35 - "title": "Memory Usage", 36 - "type": "gauge", 37 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 38 - "expr": "100 * (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes))", 39 - "legendFormat": "Memory %", "refId": "A" }] }, 29 + "title": "Memory Usage", "type": "gauge", 30 + "targets": [{ "datasource": "Prometheus", "expr": "100 * (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes))", "legendFormat": "Memory %", "refId": "A" }] }, 40 31 41 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 32 + { "datasource": "Prometheus", 42 33 "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 43 34 "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", 44 35 "steps": [{"color":"green","value":null},{"color":"yellow","value":75},{"color":"red","value":90}] }, 45 36 "unit": "percent" }, "overrides": [] }, 46 37 "gridPos": { "h": 6, "w": 4, "x": 8, "y": 1 }, 47 38 "id": 3, "options": { "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"] }, "showThresholdLabels": false, "showThresholdMarkers": true }, 48 - "title": "Root Disk Usage", 49 - "type": "gauge", 50 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 51 - "expr": "100 - (node_filesystem_avail_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"} * 100)", 52 - "legendFormat": "/ disk %", "refId": "A" }] }, 39 + "title": "Root Disk Usage", "type": "gauge", 40 + "targets": [{ "datasource": "Prometheus", "expr": "100 - (node_filesystem_avail_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{mountpoint=\"/\",fstype!~\"tmpfs|overlay\"} * 100)", "legendFormat": "/ disk %", "refId": "A" }] }, 53 41 54 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 42 + { "datasource": "Prometheus", 55 43 "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 56 44 "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", 57 45 "steps": [{"color":"green","value":null},{"color":"yellow","value":75},{"color":"red","value":90}] }, 58 46 "unit": "percent" }, "overrides": [] }, 59 47 "gridPos": { "h": 6, "w": 4, "x": 12, "y": 1 }, 60 48 "id": 4, "options": { "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"] }, "showThresholdLabels": false, "showThresholdMarkers": true }, 61 - "title": "/srv Disk Usage", 62 - "type": "gauge", 63 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 64 - "expr": "100 - (node_filesystem_avail_bytes{mountpoint=\"/srv\",fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{mountpoint=\"/srv\",fstype!~\"tmpfs|overlay\"} * 100)", 65 - "legendFormat": "/srv disk %", "refId": "A" }] }, 49 + "title": "/srv Disk Usage", "type": "gauge", 50 + "targets": [{ "datasource": "Prometheus", "expr": "100 - (node_filesystem_avail_bytes{mountpoint=\"/srv\",fstype!~\"tmpfs|overlay\"} / node_filesystem_size_bytes{mountpoint=\"/srv\",fstype!~\"tmpfs|overlay\"} * 100)", "legendFormat": "/srv disk %", "refId": "A" }] }, 66 51 67 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 68 - "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 69 - "mappings": [], "thresholds": { "mode": "absolute", "steps": [{"color":"green","value":null}] }, 70 - "unit": "s" }, "overrides": [] }, 52 + { "datasource": "Prometheus", 53 + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], 54 + "thresholds": { "mode": "absolute", "steps": [{"color":"green","value":null}] }, "unit": "s" }, "overrides": [] }, 71 55 "gridPos": { "h": 3, "w": 4, "x": 16, "y": 1 }, 72 56 "id": 5, "options": { "colorMode": "value", "graphMode": "none", "reduceOptions": { "calcs": ["lastNotNull"] } }, 73 - "title": "Uptime", 74 - "type": "stat", 75 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 76 - "expr": "time() - node_boot_time_seconds", 77 - "legendFormat": "Uptime", "refId": "A" }] }, 57 + "title": "Uptime", "type": "stat", 58 + "targets": [{ "datasource": "Prometheus", "expr": "time() - node_boot_time_seconds", "legendFormat": "Uptime", "refId": "A" }] }, 78 59 79 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 80 - "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 81 - "mappings": [], "thresholds": { "mode": "absolute", 82 - "steps": [{"color":"green","value":null},{"color":"yellow","value":4},{"color":"red","value":8}] }, 60 + { "datasource": "Prometheus", 61 + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], 62 + "thresholds": { "mode": "absolute", "steps": [{"color":"green","value":null},{"color":"yellow","value":4},{"color":"red","value":8}] }, 83 63 "unit": "short", "decimals": 2 }, "overrides": [] }, 84 64 "gridPos": { "h": 3, "w": 4, "x": 16, "y": 4 }, 85 65 "id": 6, "options": { "colorMode": "background", "graphMode": "area", "reduceOptions": { "calcs": ["lastNotNull"] } }, 86 - "title": "Load Average (15m)", 87 - "type": "stat", 88 - "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, 89 - "expr": "node_load15", 90 - "legendFormat": "Load 15m", "refId": "A" }] }, 66 + "title": "Load Average (15m)", "type": "stat", 67 + "targets": [{ "datasource": "Prometheus", "expr": "node_load15", "legendFormat": "Load 15m", "refId": "A" }] }, 91 68 92 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 93 - "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, 94 - "mappings": [], "thresholds": { "mode": "absolute", "steps": [{"color":"green","value":null}] }, 95 - "unit": "bytes" }, "overrides": [] }, 69 + { "datasource": "Prometheus", 70 + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], 71 + "thresholds": { "mode": "absolute", "steps": [{"color":"green","value":null}] }, "unit": "bytes" }, "overrides": [] }, 96 72 "gridPos": { "h": 6, "w": 4, "x": 20, "y": 1 }, 97 73 "id": 7, "options": { "colorMode": "value", "graphMode": "none", "reduceOptions": { "calcs": ["lastNotNull"] }, "orientation": "vertical" }, 98 - "title": "Memory", 99 - "type": "stat", 74 + "title": "Memory", "type": "stat", 100 75 "targets": [ 101 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 102 - "expr": "node_memory_MemTotal_bytes", "legendFormat": "Total", "refId": "A" }, 103 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 104 - "expr": "node_memory_MemAvailable_bytes", "legendFormat": "Available", "refId": "B" } 76 + { "datasource": "Prometheus", "expr": "node_memory_MemTotal_bytes", "legendFormat": "Total", "refId": "A" }, 77 + { "datasource": "Prometheus", "expr": "node_memory_MemAvailable_bytes", "legendFormat": "Available", "refId": "B" } 105 78 ] }, 106 79 107 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 80 + { "datasource": "Prometheus", 108 81 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 109 82 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "percent", "min": 0, "max": 100 }, "overrides": [] }, 110 83 "gridPos": { "h": 8, "w": 12, "x": 0, "y": 7 }, 111 84 "id": 10, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 112 - "title": "CPU Usage Over Time", 113 - "type": "timeseries", 114 - "targets": [ 115 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 116 - "expr": "100 - (avg by(cpu) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", 117 - "legendFormat": "CPU {{cpu}}", "refId": "A" } 118 - ] }, 85 + "title": "CPU Usage Over Time", "type": "timeseries", 86 + "targets": [{ "datasource": "Prometheus", "expr": "100 - (avg by(cpu) (rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", "legendFormat": "CPU {{cpu}}", "refId": "A" }] }, 119 87 120 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 88 + { "datasource": "Prometheus", 121 89 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 122 90 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "bytes", "min": 0 }, "overrides": [] }, 123 91 "gridPos": { "h": 8, "w": 12, "x": 12, "y": 7 }, 124 92 "id": 11, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 125 - "title": "Memory Over Time", 126 - "type": "timeseries", 93 + "title": "Memory Over Time", "type": "timeseries", 127 94 "targets": [ 128 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 129 - "expr": "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes", 130 - "legendFormat": "Used", "refId": "A" }, 131 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 132 - "expr": "node_memory_MemAvailable_bytes", 133 - "legendFormat": "Available", "refId": "B" }, 134 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 135 - "expr": "node_memory_Cached_bytes", 136 - "legendFormat": "Cached", "refId": "C" } 95 + { "datasource": "Prometheus", "expr": "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes", "legendFormat": "Used", "refId": "A" }, 96 + { "datasource": "Prometheus", "expr": "node_memory_MemAvailable_bytes", "legendFormat": "Available", "refId": "B" }, 97 + { "datasource": "Prometheus", "expr": "node_memory_Cached_bytes", "legendFormat": "Cached", "refId": "C" } 137 98 ] }, 138 99 139 100 { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 }, 140 101 "id": 101, "title": "Network", "type": "row" }, 141 102 142 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 103 + { "datasource": "Prometheus", 143 104 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 144 105 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "Bps" }, 145 106 "overrides": [{ "matcher": { "id": "byName", "options": "Transmit" }, 146 107 "properties": [{ "id": "custom.transform", "value": "negative-Y" }] }] }, 147 108 "gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 }, 148 109 "id": 20, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 149 - "title": "Network Traffic (eth0)", 150 - "type": "timeseries", 110 + "title": "Network Traffic (eth0)", "type": "timeseries", 151 111 "targets": [ 152 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 153 - "expr": "rate(node_network_receive_bytes_total{device=\"eth0\"}[5m])", 154 - "legendFormat": "Receive", "refId": "A" }, 155 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 156 - "expr": "rate(node_network_transmit_bytes_total{device=\"eth0\"}[5m])", 157 - "legendFormat": "Transmit", "refId": "B" } 112 + { "datasource": "Prometheus", "expr": "rate(node_network_receive_bytes_total{device=\"eth0\"}[5m])", "legendFormat": "Receive", "refId": "A" }, 113 + { "datasource": "Prometheus", "expr": "rate(node_network_transmit_bytes_total{device=\"eth0\"}[5m])", "legendFormat": "Transmit", "refId": "B" } 158 114 ] }, 159 115 160 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 116 + { "datasource": "Prometheus", 161 117 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 162 118 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "Bps" }, 163 119 "overrides": [{ "matcher": { "id": "byName", "options": "Transmit" }, 164 120 "properties": [{ "id": "custom.transform", "value": "negative-Y" }] }] }, 165 121 "gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 }, 166 122 "id": 21, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 167 - "title": "Network Traffic (tailscale0)", 168 - "type": "timeseries", 123 + "title": "Network Traffic (tailscale0)", "type": "timeseries", 169 124 "targets": [ 170 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 171 - "expr": "rate(node_network_receive_bytes_total{device=\"tailscale0\"}[5m])", 172 - "legendFormat": "Receive", "refId": "A" }, 173 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 174 - "expr": "rate(node_network_transmit_bytes_total{device=\"tailscale0\"}[5m])", 175 - "legendFormat": "Transmit", "refId": "B" } 125 + { "datasource": "Prometheus", "expr": "rate(node_network_receive_bytes_total{device=\"tailscale0\"}[5m])", "legendFormat": "Receive", "refId": "A" }, 126 + { "datasource": "Prometheus", "expr": "rate(node_network_transmit_bytes_total{device=\"tailscale0\"}[5m])", "legendFormat": "Transmit", "refId": "B" } 176 127 ] }, 177 128 178 129 { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 24 }, 179 130 "id": 102, "title": "Disk I/O", "type": "row" }, 180 131 181 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 132 + { "datasource": "Prometheus", 182 133 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 183 134 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "Bps" }, 184 135 "overrides": [{ "matcher": { "id": "byName", "options": "Write" }, 185 136 "properties": [{ "id": "custom.transform", "value": "negative-Y" }] }] }, 186 137 "gridPos": { "h": 8, "w": 12, "x": 0, "y": 25 }, 187 138 "id": 30, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 188 - "title": "Disk I/O Throughput", 189 - "type": "timeseries", 139 + "title": "Disk I/O Throughput", "type": "timeseries", 190 140 "targets": [ 191 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 192 - "expr": "rate(node_disk_read_bytes_total[5m])", 193 - "legendFormat": "Read {{device}}", "refId": "A" }, 194 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 195 - "expr": "rate(node_disk_written_bytes_total[5m])", 196 - "legendFormat": "Write {{device}}", "refId": "B" } 141 + { "datasource": "Prometheus", "expr": "rate(node_disk_read_bytes_total[5m])", "legendFormat": "Read {{device}}", "refId": "A" }, 142 + { "datasource": "Prometheus", "expr": "rate(node_disk_written_bytes_total[5m])", "legendFormat": "Write {{device}}", "refId": "B" } 197 143 ] }, 198 144 199 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 145 + { "datasource": "Prometheus", 200 146 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 201 147 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "ms" } }, 202 148 "gridPos": { "h": 8, "w": 12, "x": 12, "y": 25 }, 203 149 "id": 31, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 204 - "title": "Disk I/O Latency", 205 - "type": "timeseries", 150 + "title": "Disk I/O Latency", "type": "timeseries", 206 151 "targets": [ 207 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 208 - "expr": "rate(node_disk_read_time_seconds_total[5m]) / rate(node_disk_reads_completed_total[5m]) * 1000", 209 - "legendFormat": "Read {{device}}", "refId": "A" }, 210 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 211 - "expr": "rate(node_disk_write_time_seconds_total[5m]) / rate(node_disk_writes_completed_total[5m]) * 1000", 212 - "legendFormat": "Write {{device}}", "refId": "B" } 152 + { "datasource": "Prometheus", "expr": "rate(node_disk_read_time_seconds_total[5m]) / rate(node_disk_reads_completed_total[5m]) * 1000", "legendFormat": "Read {{device}}", "refId": "A" }, 153 + { "datasource": "Prometheus", "expr": "rate(node_disk_write_time_seconds_total[5m]) / rate(node_disk_writes_completed_total[5m]) * 1000", "legendFormat": "Write {{device}}", "refId": "B" } 213 154 ] }, 214 155 215 156 { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 33 }, 216 157 "id": 103, "title": "Caddy", "type": "row" }, 217 158 218 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 159 + { "datasource": "Prometheus", 219 160 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 220 161 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "reqps" } }, 221 162 "gridPos": { "h": 8, "w": 12, "x": 0, "y": 34 }, 222 163 "id": 40, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 223 - "title": "Request Rate by Status Code", 224 - "type": "timeseries", 225 - "targets": [ 226 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 227 - "expr": "sum by(code) (rate(caddy_http_requests_total[5m]))", 228 - "legendFormat": "{{code}}", "refId": "A" } 229 - ] }, 164 + "title": "Request Rate by Status Code", "type": "timeseries", 165 + "targets": [{ "datasource": "Prometheus", "expr": "sum by(code) (rate(caddy_http_requests_total[5m]))", "legendFormat": "{{code}}", "refId": "A" }] }, 230 166 231 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 167 + { "datasource": "Prometheus", 232 168 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 233 169 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "s" } }, 234 170 "gridPos": { "h": 8, "w": 12, "x": 12, "y": 34 }, 235 171 "id": 41, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 236 - "title": "Request Duration (p50/p95/p99)", 237 - "type": "timeseries", 172 + "title": "Request Duration (p50/p95/p99)", "type": "timeseries", 238 173 "targets": [ 239 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 240 - "expr": "histogram_quantile(0.50, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", 241 - "legendFormat": "p50", "refId": "A" }, 242 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 243 - "expr": "histogram_quantile(0.95, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", 244 - "legendFormat": "p95", "refId": "B" }, 245 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 246 - "expr": "histogram_quantile(0.99, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", 247 - "legendFormat": "p99", "refId": "C" } 174 + { "datasource": "Prometheus", "expr": "histogram_quantile(0.50, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", "legendFormat": "p50", "refId": "A" }, 175 + { "datasource": "Prometheus", "expr": "histogram_quantile(0.95, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", "legendFormat": "p95", "refId": "B" }, 176 + { "datasource": "Prometheus", "expr": "histogram_quantile(0.99, sum by(le) (rate(caddy_http_request_duration_seconds_bucket[5m])))", "legendFormat": "p99", "refId": "C" } 248 177 ] }, 249 178 250 179 { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 42 }, 251 180 "id": 104, "title": "PostgreSQL", "type": "row" }, 252 181 253 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 182 + { "datasource": "Prometheus", 254 183 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 255 184 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "short" } }, 256 185 "gridPos": { "h": 8, "w": 12, "x": 0, "y": 43 }, 257 186 "id": 50, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 258 - "title": "DB Connections", 259 - "type": "timeseries", 260 - "targets": [ 261 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 262 - "expr": "pg_stat_activity_count", 263 - "legendFormat": "{{datname}} – {{state}}", "refId": "A" } 264 - ] }, 187 + "title": "DB Connections", "type": "timeseries", 188 + "targets": [{ "datasource": "Prometheus", "expr": "pg_stat_activity_count", "legendFormat": "{{datname}} – {{state}}", "refId": "A" }] }, 265 189 266 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 190 + { "datasource": "Prometheus", 267 191 "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, 268 192 "custom": { "lineWidth": 2, "fillOpacity": 10 }, "unit": "ops" } }, 269 193 "gridPos": { "h": 8, "w": 12, "x": 12, "y": 43 }, 270 194 "id": 51, "options": { "tooltip": { "mode": "multi" }, "legend": { "displayMode": "list", "placement": "bottom" } }, 271 - "title": "DB Transactions/sec", 272 - "type": "timeseries", 195 + "title": "DB Transactions/sec", "type": "timeseries", 273 196 "targets": [ 274 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 275 - "expr": "rate(pg_stat_database_xact_commit[5m])", 276 - "legendFormat": "commit {{datname}}", "refId": "A" }, 277 - { "datasource": { "type": "prometheus", "uid": "prometheus" }, 278 - "expr": "rate(pg_stat_database_xact_rollback[5m])", 279 - "legendFormat": "rollback {{datname}}", "refId": "B" } 197 + { "datasource": "Prometheus", "expr": "rate(pg_stat_database_xact_commit[5m])", "legendFormat": "commit {{datname}}", "refId": "A" }, 198 + { "datasource": "Prometheus", "expr": "rate(pg_stat_database_xact_rollback[5m])", "legendFormat": "rollback {{datname}}", "refId": "B" } 280 199 ] } 281 200 ], 282 201 "refresh": "30s",
-1
modules/grafana.nix
··· 137 137 { 138 138 name = "Prometheus"; 139 139 type = "prometheus"; 140 - uid = "prometheus"; 141 140 url = "http://127.0.0.1:${toString prometheusPort}"; 142 141 isDefault = true; 143 142 }