From 90c01dea89657f8c1e236dcbe8b87d482622dd55 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Thu, 22 Oct 2026 10:58:15 +0200 Subject: [PATCH] Scrape Immich PostgreSQL metrics with Prometheus --- apps/immich-postgresql/kustomization.yaml | 3 ++- apps/immich-postgresql/pod-monitor.yaml | 17 +++++++++++++++++ bootstrap/immich-project.yaml | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 apps/immich-postgresql/pod-monitor.yaml diff --git a/apps/immich-postgresql/kustomization.yaml b/apps/immich-postgresql/kustomization.yaml index 993fbde..e35ee07 100644 --- a/apps/immich-postgresql/kustomization.yaml +++ b/apps/immich-postgresql/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - cluster.yaml +- cluster.yaml +- pod-monitor.yaml diff --git a/apps/immich-postgresql/pod-monitor.yaml b/apps/immich-postgresql/pod-monitor.yaml new file mode 100644 index 0000000..807ce1c --- /dev/null +++ b/apps/immich-postgresql/pod-monitor.yaml @@ -0,0 +1,17 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: immich-postgresql-prometheus + namespace: immich + labels: + release: prometheus +spec: + namespaceSelector: + matchNames: + - immich + selector: + matchLabels: + cnpg.io/cluster: immich-postgresql + cnpg.io/podRole: instance + podMetricsEndpoints: + - port: metrics diff --git a/bootstrap/immich-project.yaml b/bootstrap/immich-project.yaml index cfe5567..82eaed9 100644 --- a/bootstrap/immich-project.yaml +++ b/bootstrap/immich-project.yaml @@ -31,9 +31,13 @@ spec: kind: Deployment - group: networking.k8s.io kind: Ingress + - group: monitoring.coreos.com + kind: PodMonitor - group: monitoring.coreos.com kind: ServiceMonitor - group: postgresql.cnpg.io kind: Cluster - group: traefik.io kind: IngressRoute + - group: traefik.io + kind: ServersTransport