Skip to content

Commit 0aa0a8e

Browse files
committed
[mariadb] update mysqld-exporter to version 0.15.1
Remove DATA_SOURCE_NAME secret, use MYSQLD_EXPORTER_PASSWORD and constructed mysqld.address option Update alerts: The metric mysql_info_schema_threads_seconds has been renamed to mysql_info_schema_processlist_seconds with exporter v0.14.0+ see prometheus/mysqld_exporter#603
1 parent 93ad009 commit 0aa0a8e

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

common/mariadb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
description: A Helm chart for Kubernetes
33
name: mariadb
4-
version: 0.12.1
4+
version: 0.13.0

common/mariadb/ci/test-values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ global:
44
registry: my.docker.registry
55
dockerHubMirror: my.dockerhub.mirror
66
dockerHubMirrorAlternateRegion: other.dockerhub.mirror
7+
tld: ""
8+
region: local
79

810
test_db_host: testRelease-mariadb.svc
911
root_password: secret123
@@ -15,3 +17,6 @@ backup:
1517

1618
backup_v2:
1719
enabled: false
20+
21+
alerts:
22+
support_group: test

common/mariadb/templates/_helpers.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
{{- required ".Values.root_password missing" .Values.root_password }}
2121
{{- end -}}
2222

23-
{{ define "mariadb.metrics_data_source" }}root:{{ required ".Values.root_password missing" .Values.root_password }}@tcp({{.Values.name}}-mariadb.{{.Release.Namespace}}.svc.kubernetes.{{.Values.global.region}}.{{.Values.global.tld}}:3306)/{{ end }}
23+
{{- define "mariadb.metrics_target_address" -}}
24+
{{.Values.name}}-mariadb.{{.Release.Namespace}}.svc.kubernetes.{{.Values.global.region}}.{{.Values.global.tld}}:3306
25+
{{- end -}}
2426

2527
{{- define "db_password" -}}
2628
{{- .Values.global.dbPassword }}

common/mariadb/templates/alerts/_mysql.alerts.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
summary: {{ include "fullName" . }} reports slow queries.
2929

3030
- alert: {{ include "alerts.service" . | title }}MariaDBWaitingForLock
31-
expr: (mysql_info_schema_threads_seconds{app=~"{{ include "fullName" . }}", state=~"waiting for lock"} / 1000 > 15)
31+
expr: (mysql_info_schema_processlist_seconds{app=~"{{ include "fullName" . }}", state=~"waiting for lock"} / 1000 > 15)
3232
for: 10m
3333
labels:
3434
context: database

common/mariadb/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ spec:
134134
image: "{{ required ".Values.global.dockerHubMirrorAlternateRegion is missing" .Values.global.dockerHubMirrorAlternateRegion }}/{{ .Values.metrics.image }}:{{ .Values.metrics.image_version }}"
135135
imagePullPolicy: {{ default "IfNotPresent" .Values.imagePullPolicy | quote }}
136136
args:
137+
- "--mysqld.username=root"
138+
- "--mysqld.address={{ include "mariadb.metrics_target_address" . }}"
137139
{{- range $flag := .Values.metrics.flags }}
138140
- "--{{$flag}}"
139141
{{- end }}
@@ -152,11 +154,11 @@ spec:
152154
periodSeconds: 20
153155
timeoutSeconds: 10
154156
env:
155-
- name: DATA_SOURCE_NAME
157+
- name: MYSQLD_EXPORTER_PASSWORD
156158
valueFrom:
157159
secretKeyRef:
158160
name: mariadb-{{.Values.name}}
159-
key: metrics-data-source
161+
key: root-password
160162
- name: LOGLEVEL
161163
value: {{ default "info" .Values.metrics.loglevel }}
162164
ports:

common/mariadb/templates/secret.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ metadata:
1010
type: Opaque
1111
data:
1212
root-password: {{ include "mariadb.root_password" . | b64enc | quote }}
13-
metrics-data-source: {{ include "mariadb.metrics_data_source" . | b64enc | quote }}
1413
{{- if .Values.backup_v2.enabled }}
1514
{{- if .Values.backup_v2.oauth.enabled }}
1615
OAUTH_CLIENT_ID: {{ default "" .Values.backup_v2.oauth.client_id | b64enc | quote }}

common/mariadb/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ backup_v2:
142142
metrics:
143143
enabled: true
144144
image: prom/mysqld-exporter
145-
image_version: v0.12.1
145+
image_version: v0.15.1
146146
port: "9104"
147147
flags:
148148
- collect.binlog_size

0 commit comments

Comments
 (0)