From 441f0748e967bee46820fc62f143f44ff0b9e1dc Mon Sep 17 00:00:00 2001 From: modzilla Date: Mon, 7 Jun 2021 22:28:28 +0800 Subject: [PATCH] Fixing prometheus monitoring (#157) At least the latest versions of prometheus watch for a label called "release" and not "prometheus" so with that change prometheus started collecting logs. If that old label is still needed, we / I could change it to add entries from "additionalLabels", so that we are quite flexible and don't have breaking changes. Co-authored-by: Justin Lamp Co-authored-by: techknowlogick Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/157 Reviewed-by: luhahn Reviewed-by: techknowlogick Co-authored-by: modzilla Co-committed-by: modzilla --- templates/gitea/servicemonitor.yaml | 4 ++-- values.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/gitea/servicemonitor.yaml b/templates/gitea/servicemonitor.yaml index 8f22ea5..02750d0 100644 --- a/templates/gitea/servicemonitor.yaml +++ b/templates/gitea/servicemonitor.yaml @@ -5,8 +5,8 @@ metadata: name: {{ include "gitea.fullname" . }} labels: {{- include "gitea.labels" . | nindent 4 }} - {{- if .Values.gitea.metrics.serviceMonitor.prometheusSelector }} - prometheus: {{ .Values.gitea.metrics.serviceMonitor.prometheusSelector }} + {{- if .Values.gitea.metrics.serviceMonitor.additionalLabels }} + {{- toYaml .Values.gitea.metrics.serviceMonitor.additionalLabels | nindent 4 }} {{- end }} spec: selector: diff --git a/values.yaml b/values.yaml index dc73b04..e1a2526 100644 --- a/values.yaml +++ b/values.yaml @@ -131,7 +131,8 @@ gitea: enabled: false serviceMonitor: enabled: false - # prometheusSelector: default + # additionalLabels: + # prometheus-release: prom1 ldap: enabled: false