From 212faf95a493191ddef1855acf78680d11886f1b Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Thu, 22 Oct 2026 11:05:48 +0200 Subject: [PATCH] Add Immich Grafana dashboard --- apps/immich/resources/dashboard.yaml | 76 ++++++++++++++++++++++++ apps/immich/resources/kustomization.yaml | 1 + 2 files changed, 77 insertions(+) create mode 100644 apps/immich/resources/dashboard.yaml diff --git a/apps/immich/resources/dashboard.yaml b/apps/immich/resources/dashboard.yaml new file mode 100644 index 0000000..0596bc0 --- /dev/null +++ b/apps/immich/resources/dashboard.yaml @@ -0,0 +1,76 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: immich-grafana-dashboard + namespace: immich + labels: + grafana_dashboard: "1" +data: + immich.json: |- + { + "uid": "immich", + "title": "Immich", + "tags": ["immich", "homelab"], + "timezone": "browser", + "schemaVersion": 39, + "version": 1, + "refresh": "30s", + "time": {"from": "now-6h", "to": "now"}, + "panels": [ + { + "id": 1, + "title": "CPU by pod and container", + "type": "timeseries", + "datasource": {"type": "prometheus", "uid": "aevstx976yku8a"}, + "gridPos": {"x": 0, "y": 0, "w": 12, "h": 8}, + "targets": [{"refId": "A", "expr": "sum by (pod, container) (rate(container_cpu_usage_seconds_total{namespace=\"immich\",pod=~\"immich-(server|machine-learning|valkey|postgresql-[0-9]+).*\",container!=\"\",container!=\"POD\"}[5m]))", "legendFormat": "{{pod}} / {{container}}"}], + "fieldConfig": {"defaults": {"unit": "cores", "custom": {"drawStyle": "line", "lineWidth": 2, "fillOpacity": 10}}, "overrides": []}, + "options": {"legend": {"displayMode": "table", "placement": "bottom"}, "tooltip": {"mode": "multi", "sort": "desc"}} + }, + { + "id": 2, + "title": "Memory working set by pod and container", + "type": "timeseries", + "datasource": {"type": "prometheus", "uid": "aevstx976yku8a"}, + "gridPos": {"x": 12, "y": 0, "w": 12, "h": 8}, + "targets": [{"refId": "A", "expr": "sum by (pod, container) (container_memory_working_set_bytes{namespace=\"immich\",pod=~\"immich-(server|machine-learning|valkey|postgresql-[0-9]+).*\",container!=\"\",container!=\"POD\"})", "legendFormat": "{{pod}} / {{container}}"}], + "fieldConfig": {"defaults": {"unit": "bytes", "custom": {"drawStyle": "line", "lineWidth": 2, "fillOpacity": 10}}, "overrides": []}, + "options": {"legend": {"displayMode": "table", "placement": "bottom"}, "tooltip": {"mode": "multi", "sort": "desc"}} + }, + { + "id": 3, + "title": "Network throughput by pod", + "type": "timeseries", + "datasource": {"type": "prometheus", "uid": "aevstx976yku8a"}, + "gridPos": {"x": 0, "y": 8, "w": 12, "h": 8}, + "targets": [ + {"refId": "A", "expr": "sum by (pod) (rate(container_network_receive_bytes_total{namespace=\"immich\",pod=~\"immich-(server|machine-learning|valkey|postgresql-[0-9]+).*\",interface!=\"lo\"}[5m]))", "legendFormat": "{{pod}} receive"}, + {"refId": "B", "expr": "sum by (pod) (rate(container_network_transmit_bytes_total{namespace=\"immich\",pod=~\"immich-(server|machine-learning|valkey|postgresql-[0-9]+).*\",interface!=\"lo\"}[5m]))", "legendFormat": "{{pod}} transmit"} + ], + "fieldConfig": {"defaults": {"unit": "Bps", "custom": {"drawStyle": "line", "lineWidth": 2}}, "overrides": []}, + "options": {"legend": {"displayMode": "table", "placement": "bottom"}, "tooltip": {"mode": "multi", "sort": "desc"}} + }, + { + "id": 4, + "title": "Immich database size", + "type": "stat", + "datasource": {"type": "prometheus", "uid": "aevstx976yku8a"}, + "gridPos": {"x": 12, "y": 8, "w": 6, "h": 4}, + "targets": [{"refId": "A", "expr": "max(cnpg_pg_database_size_bytes{namespace=\"immich\",datname=\"immich\"})", "instant": true, "legendFormat": "immich"}], + "fieldConfig": {"defaults": {"unit": "bytes", "color": {"mode": "thresholds"}, "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}}, "overrides": []}, + "options": {"colorMode": "value", "graphMode": "area", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}, "orientation": "auto", "textMode": "auto"} + }, + { + "id": 5, + "title": "PostgreSQL replication lag", + "type": "timeseries", + "datasource": {"type": "prometheus", "uid": "aevstx976yku8a"}, + "gridPos": {"x": 12, "y": 12, "w": 12, "h": 4}, + "targets": [{"refId": "A", "expr": "max by (pod) (cnpg_pg_replication_lag{namespace=\"immich\"})", "legendFormat": "{{pod}}"}], + "fieldConfig": {"defaults": {"unit": "s", "custom": {"drawStyle": "line", "lineWidth": 2}}, "overrides": []}, + "options": {"legend": {"displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "multi"}} + } + ], + "annotations": {"list": []}, + "links": [] + } diff --git a/apps/immich/resources/kustomization.yaml b/apps/immich/resources/kustomization.yaml index 9740ee7..1268266 100644 --- a/apps/immich/resources/kustomization.yaml +++ b/apps/immich/resources/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - alerts.yaml +- dashboard.yaml - library-storage.yaml