From e2fad5485cc6cd474bad295968e784c9be711033 Mon Sep 17 00:00:00 2001 From: Rashmi Chandrashekar Date: Thu, 14 Mar 2024 15:01:04 -0700 Subject: [PATCH] adding api group for service monitor --- charts/kafka-exporter/templates/servicemonitor.yaml | 4 ++++ charts/kafka-exporter/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/charts/kafka-exporter/templates/servicemonitor.yaml b/charts/kafka-exporter/templates/servicemonitor.yaml index 2efc6d6c..f4045fa8 100644 --- a/charts/kafka-exporter/templates/servicemonitor.yaml +++ b/charts/kafka-exporter/templates/servicemonitor.yaml @@ -1,5 +1,9 @@ {{- if .Values.prometheus.serviceMonitor.enabled }} +{{- if .Values.azuremanagedprometheus.use_azuremanagedprometheus }} +apiVersion: azmonitoring.coreos.com/v1 +{{- else }} apiVersion: monitoring.coreos.com/v1 +{{- end }} kind: ServiceMonitor metadata: name: {{ include "kafka-exporter.fullname" . }} diff --git a/charts/kafka-exporter/values.yaml b/charts/kafka-exporter/values.yaml index 6af50b12..2fc97147 100644 --- a/charts/kafka-exporter/values.yaml +++ b/charts/kafka-exporter/values.yaml @@ -64,6 +64,10 @@ datadog: {"kafka_consumergroup_current_offset": "kafka_consumergroup_current_offset"} ] +# Add support for azure managed prometheus by creating service monitor with the supported api group +azuremanagedprometheus: + use_azuremanagedprometheus: false + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little