diff --git a/stable/prometheus-mysql-exporter/Chart.yaml b/stable/prometheus-mysql-exporter/Chart.yaml index c63336548d66..0de7485e4949 100644 --- a/stable/prometheus-mysql-exporter/Chart.yaml +++ b/stable/prometheus-mysql-exporter/Chart.yaml @@ -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: diff --git a/stable/prometheus-mysql-exporter/README.md b/stable/prometheus-mysql-exporter/README.md index f2337b3dfd31..95e19811739e 100644 --- a/stable/prometheus-mysql-exporter/README.md +++ b/stable/prometheus-mysql-exporter/README.md @@ -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, diff --git a/stable/prometheus-mysql-exporter/templates/servicemonitor.yaml b/stable/prometheus-mysql-exporter/templates/servicemonitor.yaml index 2127d097e2af..24c5f7479b8d 100644 --- a/stable/prometheus-mysql-exporter/templates/servicemonitor.yaml +++ b/stable/prometheus-mysql-exporter/templates/servicemonitor.yaml @@ -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 }} diff --git a/stable/prometheus-mysql-exporter/values.yaml b/stable/prometheus-mysql-exporter/values.yaml index d1e48a4c1278..1f2309f646a9 100644 --- a/stable/prometheus-mysql-exporter/values.yaml +++ b/stable/prometheus-mysql-exporter/values.yaml @@ -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