Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Mysql exporter managing labels #15349

Merged
merged 3 commits into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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