From bda79fbbc10e13f0f1d966a81742db508dec7d71 Mon Sep 17 00:00:00 2001 From: Sam Nguyen <118077+dtjm@users.noreply.github.com> Date: Thu, 18 Jul 2024 20:41:21 -0700 Subject: [PATCH 1/4] fix issue with ServiceMonitor namespace --- helm/README.md | 1 + helm/templates/servicemonitor.yaml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/helm/README.md b/helm/README.md index 68f96534..d4051929 100644 --- a/helm/README.md +++ b/helm/README.md @@ -54,6 +54,7 @@ helm install sql_exporter/sql-exporter |-----|------|---------|-------------| | serviceMonitor.enabled | bool | `true` | Enable ServiceMonitor | | serviceMonitor.interval | string | `"15s"` | ServiceMonitor interval | +| serviceMonitor.namespace | string | `{{ .Release.Namespace }}` | override for the namespace where the ServiceMonitor will be deployed | | serviceMonitor.path | string | `"/metrics"` | ServiceMonitor path | | serviceMonitor.metricRelabelings | object | `{}` | ServiceMonitor metric relabelings | | serviceMonitor.scrapeTimeout | string | `nil` | ServiceMonitor scrape timeout | diff --git a/helm/templates/servicemonitor.yaml b/helm/templates/servicemonitor.yaml index 47af3bc1..c7f69935 100644 --- a/helm/templates/servicemonitor.yaml +++ b/helm/templates/servicemonitor.yaml @@ -34,5 +34,9 @@ spec: {{- end }} namespaceSelector: matchNames: + {{- if .Values.serviceMonitor.namespace }} + - {{ .Values.serviceMonitor.namespace }} + {{- else }} - {{ .Release.Namespace }} + {{- end }} {{- end }} From 1340b8f123ef16411f31a6f53ee631bab04807fb Mon Sep 17 00:00:00 2001 From: Sam Nguyen <118077+dtjm@users.noreply.github.com> Date: Thu, 18 Jul 2024 20:44:34 -0700 Subject: [PATCH 2/4] update values.yaml with serviceMonitor.namespace --- helm/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm/values.yaml b/helm/values.yaml index 28fe0ff7..ddf1c4a5 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -79,6 +79,8 @@ serviceMonitor: # scrapeTimeout: 10s # -- ServiceMonitor metric relabelings metricRelabelings: {} + # -- ServiceMonitor namespace override (default is .Release.Namespace) + namespace: ~ # Additional env variables # - kind should be either Secret or ConfigMap # - name is the name of the Secret or ConfigMap that should be used From 6503d05ac770cd0649f4706428d966dc853ac781 Mon Sep 17 00:00:00 2001 From: Sam Nguyen <118077+dtjm@users.noreply.github.com> Date: Thu, 18 Jul 2024 22:19:34 -0700 Subject: [PATCH 3/4] bump version https://github.com/burningalchemist/sql_exporter/actions/runs/10002245265/job/27649175837#step:9:34 --- helm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index d225dc85..2f7fb38e 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sql-exporter description: Database-agnostic SQL exporter for Prometheus type: application -version: 0.6.0 +version: 0.6.1 appVersion: 0.15.0 keywords: - exporter From eb65d16758628d3d76d0d7596f107b60b478f74b Mon Sep 17 00:00:00 2001 From: Sam Nguyen <118077+dtjm@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:42:19 -0700 Subject: [PATCH 4/4] run `make gen_docs` --- helm/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/README.md b/helm/README.md index d4051929..0e1ad22a 100644 --- a/helm/README.md +++ b/helm/README.md @@ -1,6 +1,6 @@ # sql-exporter -![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square) +![Version: 0.6.1](https://img.shields.io/badge/Version-0.6.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square) Database-agnostic SQL exporter for Prometheus @@ -54,9 +54,9 @@ helm install sql_exporter/sql-exporter |-----|------|---------|-------------| | serviceMonitor.enabled | bool | `true` | Enable ServiceMonitor | | serviceMonitor.interval | string | `"15s"` | ServiceMonitor interval | -| serviceMonitor.namespace | string | `{{ .Release.Namespace }}` | override for the namespace where the ServiceMonitor will be deployed | | serviceMonitor.path | string | `"/metrics"` | ServiceMonitor path | | serviceMonitor.metricRelabelings | object | `{}` | ServiceMonitor metric relabelings | +| serviceMonitor.namespace | string | `nil` | ServiceMonitor namespace override (default is .Release.Namespace) | | serviceMonitor.scrapeTimeout | string | `nil` | ServiceMonitor scrape timeout | ### Configuration