From c8834dd9c35aa9fd50c63bf8382dc7fadb89d689 Mon Sep 17 00:00:00 2001 From: Alexandre Joris Date: Fri, 3 Jan 2025 14:52:13 +0100 Subject: [PATCH] [kube-prometheus-stack] Added fallbackScrapeProtocol option to additionalServiceMonitors and additionalPodMonitors (#5108) Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Co-authored-by: Duncan Schulze <13733349+duncaan@users.noreply.github.com> Co-authored-by: Alexandre Joris Co-authored-by: Ilia Lazebnik --- charts/kube-prometheus-stack/Chart.yaml | 2 +- .../templates/prometheus/podmonitors.yaml | 3 +++ .../templates/prometheus/servicemonitors.yaml | 3 +++ charts/kube-prometheus-stack/values.yaml | 10 ++++++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 0ac40278a565..e479711e8b48 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 67.6.0 +version: 67.7.0 appVersion: v0.79.2 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/prometheus/podmonitors.yaml b/charts/kube-prometheus-stack/templates/prometheus/podmonitors.yaml index 4e748c23b5c9..b9609d807ccf 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/podmonitors.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/podmonitors.yaml @@ -34,5 +34,8 @@ items: {{- if .sampleLimit }} sampleLimit: {{ .sampleLimit }} {{- end }} + {{- if .fallbackScrapeProtocol }} + fallbackScrapeProtocol: {{ .fallbackScrapeProtocol }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/servicemonitors.yaml b/charts/kube-prometheus-stack/templates/prometheus/servicemonitors.yaml index a7a301babc4e..96a7ed65092b 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/servicemonitors.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/servicemonitors.yaml @@ -43,5 +43,8 @@ items: relabelings: {{ toYaml .relabelings | indent 8 }} {{- end }} + {{- if .fallbackScrapeProtocol }} + fallbackScrapeProtocol: {{ .fallbackScrapeProtocol }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 84eb44eaca89..6e96b684923c 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -4424,6 +4424,11 @@ prometheus: # replacement: $1 # action: replace + ## Fallback scrape protocol used by Prometheus for scraping metrics + ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ScrapeProtocol + ## + # fallbackScrapeProtocol: "" + additionalPodMonitors: [] ## Name of the PodMonitor to create ## @@ -4479,6 +4484,11 @@ prometheus: ## # podMetricsEndpoints: [] + ## Fallback scrape protocol used by Prometheus for scraping metrics + ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ScrapeProtocol + ## + # fallbackScrapeProtocol: "" + ## Configuration for thanosRuler ## ref: https://thanos.io/tip/components/rule.md/ ##