Skip to content

Commit

Permalink
fix(helm): ServiceMonitor namespace override (#563)
Browse files Browse the repository at this point in the history
* fix issue with ServiceMonitor namespace

* update values.yaml with serviceMonitor.namespace

* bump version 

https://github.com/burningalchemist/sql_exporter/actions/runs/10002245265/job/27649175837#step:9:34

* run `make gen_docs`
  • Loading branch information
dtjm authored Jul 19, 2024
1 parent e716263 commit 8ce8744
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion helm/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -56,6 +56,7 @@ helm install sql_exporter/sql-exporter
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor interval |
| 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
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@ spec:
{{- end }}
namespaceSelector:
matchNames:
{{- if .Values.serviceMonitor.namespace }}
- {{ .Values.serviceMonitor.namespace }}
{{- else }}
- {{ .Release.Namespace }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ce8744

Please sign in to comment.