|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: cryptoscope-dashboard |
| 5 | + namespace: monitoring |
| 6 | + labels: |
| 7 | + grafana_dashboard: "1" |
| 8 | +data: |
| 9 | + cryptoscope.json: | |
| 10 | + { |
| 11 | + "title": "CryptoScope", |
| 12 | + "uid": "cryptoscope-main", |
| 13 | + "timezone": "browser", |
| 14 | + "schemaVersion": 38, |
| 15 | + "refresh": "30s", |
| 16 | + "panels": [ |
| 17 | + { |
| 18 | + "id": 1, |
| 19 | + "title": "Request rate (req/s)", |
| 20 | + "type": "timeseries", |
| 21 | + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}, |
| 22 | + "targets": [{ |
| 23 | + "expr": "sum(rate(http_requests_total{namespace=\"cryptoscope\"}[1m]))", |
| 24 | + "legendFormat": "requests/sec" |
| 25 | + }] |
| 26 | + }, |
| 27 | + { |
| 28 | + "id": 2, |
| 29 | + "title": "Request latency p95 (ms)", |
| 30 | + "type": "timeseries", |
| 31 | + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}, |
| 32 | + "targets": [{ |
| 33 | + "expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{namespace=\"cryptoscope\"}[5m])) by (le)) * 1000", |
| 34 | + "legendFormat": "p95 latency" |
| 35 | + }] |
| 36 | + }, |
| 37 | + { |
| 38 | + "id": 3, |
| 39 | + "title": "Error rate (%)", |
| 40 | + "type": "timeseries", |
| 41 | + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}, |
| 42 | + "targets": [{ |
| 43 | + "expr": "sum(rate(http_requests_total{namespace=\"cryptoscope\",status=~\"5..\"}[1m])) / sum(rate(http_requests_total{namespace=\"cryptoscope\"}[1m])) * 100", |
| 44 | + "legendFormat": "error %" |
| 45 | + }] |
| 46 | + }, |
| 47 | + { |
| 48 | + "id": 4, |
| 49 | + "title": "Pod count", |
| 50 | + "type": "stat", |
| 51 | + "gridPos": {"h": 8, "w": 6, "x": 12, "y": 8}, |
| 52 | + "targets": [{ |
| 53 | + "expr": "count(kube_pod_status_ready{namespace=\"cryptoscope\",condition=\"true\"})", |
| 54 | + "legendFormat": "ready pods" |
| 55 | + }] |
| 56 | + }, |
| 57 | + { |
| 58 | + "id": 5, |
| 59 | + "title": "Memory usage (MB)", |
| 60 | + "type": "timeseries", |
| 61 | + "gridPos": {"h": 8, "w": 6, "x": 18, "y": 8}, |
| 62 | + "targets": [{ |
| 63 | + "expr": "sum(container_memory_working_set_bytes{namespace=\"cryptoscope\",container!=\"\"}) by (pod) / 1024 / 1024", |
| 64 | + "legendFormat": "{{pod}}" |
| 65 | + }] |
| 66 | + }, |
| 67 | + { |
| 68 | + "id": 6, |
| 69 | + "title": "CPU usage (cores)", |
| 70 | + "type": "timeseries", |
| 71 | + "gridPos": {"h": 8, "w": 12, "x": 0, "y": 16}, |
| 72 | + "targets": [{ |
| 73 | + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"cryptoscope\",container!=\"\"}[1m])) by (pod)", |
| 74 | + "legendFormat": "{{pod}}" |
| 75 | + }] |
| 76 | + }, |
| 77 | + { |
| 78 | + "id": 7, |
| 79 | + "title": "HPA replica count", |
| 80 | + "type": "timeseries", |
| 81 | + "gridPos": {"h": 8, "w": 12, "x": 12, "y": 16}, |
| 82 | + "targets": [ |
| 83 | + { |
| 84 | + "expr": "kube_horizontalpodautoscaler_status_current_replicas{namespace=\"cryptoscope\"}", |
| 85 | + "legendFormat": "{{horizontalpodautoscaler}} current" |
| 86 | + }, |
| 87 | + { |
| 88 | + "expr": "kube_horizontalpodautoscaler_spec_max_replicas{namespace=\"cryptoscope\"}", |
| 89 | + "legendFormat": "{{horizontalpodautoscaler}} max" |
| 90 | + } |
| 91 | + ] |
| 92 | + } |
| 93 | + ] |
| 94 | + } |
0 commit comments