Add PodMonitor for crunchy exporter.
This commit is contained in:
parent
93a10ea9e3
commit
0490a15eec
2 changed files with 31 additions and 0 deletions
|
@ -6,3 +6,4 @@ namespace: database
|
||||||
resources:
|
resources:
|
||||||
- ./helmrelease.yaml
|
- ./helmrelease.yaml
|
||||||
- ./objectbucketclaim.yaml
|
- ./objectbucketclaim.yaml
|
||||||
|
- ./podmonitor.yaml
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# yaml-language-server: $schema=https://ks.hsn.dev/monitoring.coreos.com/podmonitor_v1.json
|
||||||
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: PodMonitor
|
||||||
|
metadata:
|
||||||
|
name: crunchy-postgres-exporter
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
postgres-operator.crunchydata.com/crunchy-postgres-exporter: "true"
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: "9187"
|
||||||
|
relabelings:
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_container_port_number]
|
||||||
|
action: keep
|
||||||
|
regex: "9187"
|
||||||
|
- sourceLabels: [__meta_kubernetes_namespace]
|
||||||
|
targetLabel: kubernetes_namespace
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_name]
|
||||||
|
targetLabel: pod
|
||||||
|
- sourceLabels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_label_postgres_operator_crunchydata_com_cluster]
|
||||||
|
separator: ":"
|
||||||
|
targetLabel: pg_cluster
|
||||||
|
replacement: "$1$2"
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_ip]
|
||||||
|
targetLabel: ip
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_instance]
|
||||||
|
targetLabel: deployment
|
||||||
|
- sourceLabels: [__meta_kubernetes_pod_label_postgres_operator_crunchydata_com_role]
|
||||||
|
targetLabel: role
|
Reference in a new issue