observability: scrape CloudNativePG postgres metrics (VMPodScrape)
Follow-up to #239. Every CNPG instance pod exposes metrics on :9187 but nothing scraped them. Add one namespace-wide VMPodScrape (namespaceSelector any, selector cnpg.io/podRole=instance) so the VMAgent collects postgres metrics for all ~23 CNPG clusters (authentik, grafana, woodpecker, etc.).
This commit is contained in:
@@ -8,3 +8,4 @@ resources:
|
|||||||
- vmagent.yaml
|
- vmagent.yaml
|
||||||
- gateway.yaml
|
- gateway.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
|
- vmpodscrape-cnpg.yaml
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
# Scrape metrics (:9187) from every CloudNativePG postgres instance pod in any
|
||||||
|
# namespace. Picked up by the observability VMAgent (selectAllByDefault).
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: cnpg-clusters
|
||||||
|
namespace: observability
|
||||||
|
spec:
|
||||||
|
namespaceSelector:
|
||||||
|
any: true
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
cnpg.io/podRole: instance
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: metrics
|
||||||
|
path: /metrics
|
||||||
Reference in New Issue
Block a user