diff --git a/charts/pulsar/templates/autorecovery-podmonitor.yaml b/charts/pulsar/templates/autorecovery-podmonitor.yaml index 3ec8968a..213b5893 100644 --- a/charts/pulsar/templates/autorecovery-podmonitor.yaml +++ b/charts/pulsar/templates/autorecovery-podmonitor.yaml @@ -48,6 +48,9 @@ spec: - sourceLabels: [__meta_kubernetes_pod_name] action: replace targetLabel: kubernetes_pod_name + {{- if $.Values.autorecovery.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.autorecovery.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} diff --git a/charts/pulsar/templates/bookkeeper-podmonitor.yaml b/charts/pulsar/templates/bookkeeper-podmonitor.yaml index a85441be..f2c41bc1 100644 --- a/charts/pulsar/templates/bookkeeper-podmonitor.yaml +++ b/charts/pulsar/templates/bookkeeper-podmonitor.yaml @@ -48,6 +48,9 @@ spec: - sourceLabels: [__meta_kubernetes_pod_name] action: replace targetLabel: kubernetes_pod_name + {{- if $.Values.bookkeeper.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.bookkeeper.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} diff --git a/charts/pulsar/templates/broker-podmonitor.yaml b/charts/pulsar/templates/broker-podmonitor.yaml index 9ea0c4c2..5d424ac3 100644 --- a/charts/pulsar/templates/broker-podmonitor.yaml +++ b/charts/pulsar/templates/broker-podmonitor.yaml @@ -48,6 +48,9 @@ spec: - sourceLabels: [__meta_kubernetes_pod_name] action: replace targetLabel: kubernetes_pod_name + {{- if $.Values.broker.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.broker.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} diff --git a/charts/pulsar/templates/proxy-podmonitor.yaml b/charts/pulsar/templates/proxy-podmonitor.yaml index 66020dce..4823bd28 100644 --- a/charts/pulsar/templates/proxy-podmonitor.yaml +++ b/charts/pulsar/templates/proxy-podmonitor.yaml @@ -48,6 +48,9 @@ spec: - sourceLabels: [__meta_kubernetes_pod_name] action: replace targetLabel: kubernetes_pod_name + {{- if $.Values.proxy.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.proxy.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} diff --git a/charts/pulsar/templates/zookeeper-podmonitor.yaml b/charts/pulsar/templates/zookeeper-podmonitor.yaml index 8da13ebc..f2de68b1 100644 --- a/charts/pulsar/templates/zookeeper-podmonitor.yaml +++ b/charts/pulsar/templates/zookeeper-podmonitor.yaml @@ -48,6 +48,9 @@ spec: - sourceLabels: [__meta_kubernetes_pod_name] action: replace targetLabel: kubernetes_pod_name + {{- if $.Values.zookeeper.podMonitor.metricRelabelings }} + metricRelabelings: {{ toYaml $.Values.zookeeper.podMonitor.metricRelabelings | nindent 8 }} + {{- end }} selector: matchLabels: {{- include "pulsar.matchLabels" . | nindent 6 }} diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index cbdc1bd2..e22218d9 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -290,6 +290,9 @@ zookeeper: enabled: true interval: 10s scrapeTimeout: 10s + metricRelabelings: + # - action: labeldrop + # regex: cluster # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change restartPodsOnConfigMapChange: false ports: @@ -432,6 +435,9 @@ bookkeeper: enabled: true interval: 10s scrapeTimeout: 10s + metricRelabelings: + # - action: labeldrop + # regex: cluster # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change restartPodsOnConfigMapChange: false ports: @@ -610,6 +616,9 @@ autorecovery: enabled: true interval: 10s scrapeTimeout: 10s + metricRelabelings: + # - action: labeldrop + # regex: cluster # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change restartPodsOnConfigMapChange: false ports: @@ -690,6 +699,9 @@ broker: enabled: true interval: 10s scrapeTimeout: 10s + metricRelabelings: + # - action: labeldrop + # regex: cluster # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change restartPodsOnConfigMapChange: false ports: @@ -825,6 +837,9 @@ proxy: enabled: true interval: 10s scrapeTimeout: 10s + metricRelabelings: + # - action: labeldrop + # regex: cluster # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change restartPodsOnConfigMapChange: false # nodeSelector: