Skip to content

Commit

Permalink
Mysql exporter managing labels (helm#15349)
Browse files Browse the repository at this point in the history
* [stable/prometheus-mysql-exporter] Add docs param for servicemonitor

Signed-off-by: Julien Girardin <[email protected]>

* [stable/prometheus-mysql-exporter] Add serviceMonitor labels management

Signed-off-by: Julien Girardin <[email protected]>

* [stable/prometheus-mysql-exporter] Bump chart version to 0.5.1

Signed-off-by: Julien Girardin <[email protected]>
  • Loading branch information
Zempashi authored and Thomas Tischner committed Aug 13, 2019
1 parent 3b88dc7 commit a2ae9b4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/prometheus-mysql-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for prometheus mysql exporter with cloudsqlproxy
name: prometheus-mysql-exporter
version: 0.5.0
version: 0.5.1
home: https://github.com/prometheus/mysqld_exporter
appVersion: v0.11.0
sources:
Expand Down
6 changes: 6 additions & 0 deletions stable/prometheus-mysql-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ The following table lists the configurable parameters of the mysql exporter char
| `cloudsqlproxy.instanceConnectionName` | Google Cloud instance connection name | `project:us-central1:dbname` |
| `cloudsqlproxy.port` | Cloud SQL Proxy listening port | `3306` |
| `cloudsqlproxy.credentials` | Cloud SQL Proxy service account credentials | `bogus credential file` |
| `serviceMonitor.enable` | Integration with prometheus-operator | `false` |
| `serviceMonitor.interval` | Interval for polling this exporter | |
| `serviceMonitor.scrapeTimeout` | Timeout where exporter is considered faulty | |
| `serviceMonitor.jobLabel` | Label to use to retrieve the job name from | `""` |
| `serviceMonitor.targetLabels` | Labels to transfer from service onto the target | `[]` |
| `serviceMonitor.podTargetLabels` | Labels to transfor from pod onto the target | `[]` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
11 changes: 11 additions & 0 deletions stable/prometheus-mysql-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ spec:
matchLabels:
app: {{ template "prometheus-mysql-exporter.name" . }}
release: {{ .Release.Name }}
{{- with .Values.serviceMonitor.jobLabel }}
jobLabel: {{ . | quote}}
{{- end }}
{{- with .Values.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
{{- with .Values.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
endpoints:
- path: /metrics
port: {{ .Values.service.name }}
Expand Down
3 changes: 3 additions & 0 deletions stable/prometheus-mysql-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ serviceMonitor:
# scrapeTimeout: 10s
# additionalLabels is the set of additional labels to add to the ServiceMonitor
additionalLabels: {}
jobLabel: ""
targetLabels: []
podTargetLabels: []

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down

0 comments on commit a2ae9b4

Please sign in to comment.