From 575fb162a8cb40c7d1b3d16f400f11e56c235b9a Mon Sep 17 00:00:00 2001 From: Wilson Mitchell Date: Sat, 25 Nov 2023 02:05:09 -0800 Subject: [PATCH] Create pod monitor for posthog nginx. --- apps/prod/posthog/ingress-nginx.yaml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/prod/posthog/ingress-nginx.yaml b/apps/prod/posthog/ingress-nginx.yaml index fdfe89b74..d65b2597a 100644 --- a/apps/prod/posthog/ingress-nginx.yaml +++ b/apps/prod/posthog/ingress-nginx.yaml @@ -426,8 +426,6 @@ spec: app.kubernetes.io/name: posthog-ingress-nginx annotations: config.linkerd.io/trace-collector: collector.linkerd-jaeger.svc.cluster.local:55678 - prometheus.io/scrape: "true" - prometheus.io/port: "10254" spec: tolerations: - key: "nginx" @@ -694,3 +692,28 @@ webhooks: resources: - ingresses sideEffects: None +--- +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: posthog-ingress-nginx-podmonitor + namespace: posthog-ingress-nginx + labels: + app.kubernetes.io/part-of: compose +spec: + podMetricsEndpoints: + - path: /metrics + targetPort: 10254 + namespaceSelector: + matchNames: + - posthog-ingress-nginx + selector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - posthog-ingress-nginx + - key: compose.ai/ignore-monitoring + operator: DoesNotExist + values: + - "ignore"