Skip to content

Commit

Permalink
chore: update mariadb exporter (#40)
Browse files Browse the repository at this point in the history
* chore: update mariadb exporter

* fix: tests dependencies
  • Loading branch information
stahntobias authored Oct 2, 2024
1 parent 1612b6a commit d97561b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Install dependencies
run: |
cd tests
cat ../jsonnetfile.lock.json > jsonnetfile.lock.json
jb install
- name: Run tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions databases/mariadb.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local p = import 'github.com/jsonnet-libs/kube-prometheus-libsonnet/0.10/main.li
database: self.user,
image: 'registry.redhat.io/rhel9/mariadb-105:1-105',
datadirAction: 'upgrade-warn', // use 'upgrade-auto' to enable auto-upgrade when going to newer MariaDB version
exporterImage: 'docker.io/prom/mysqld-exporter:v0.14.0',
exporterImage: 'docker.io/prom/mysqld-exporter:v0.15.1',
exporter_password: std.md5(self.password),
resources:: {
limits: {
Expand Down Expand Up @@ -51,7 +51,6 @@ local p = import 'github.com/jsonnet-libs/kube-prometheus-libsonnet/0.10/main.li
MYSQL_DATABASE: cfg.database,
MYSQL_EXPORTER_PASSWORD: cfg.exporter_password,
DATA_SOURCE_NAME: self.MYSQL_USER + ':' + self.MYSQL_PASSWORD + '@(127.0.0.1:3306)/',
EXPORTER_DATA_SOURCE_NAME: 'exporter:' + self.MYSQL_EXPORTER_PASSWORD + '@(127.0.0.1:3306)/',
}),
initScripts: cm.new(cfg.name + '-init', data={
'init.sql': |||
Expand Down Expand Up @@ -109,6 +108,7 @@ local p = import 'github.com/jsonnet-libs/kube-prometheus-libsonnet/0.10/main.li
+ container.resources.withLimits(cfg.resources.limits),
container.new(name='exporter', image=cfg.exporterImage)
+ container.withArgs([
'--mysqld.username=exporter',
'--collect.info_schema.innodb_metrics',
'--collect.info_schema.innodb_tablespaces',
'--collect.info_schema.innodb_cmp',
Expand All @@ -125,8 +125,8 @@ local p = import 'github.com/jsonnet-libs/kube-prometheus-libsonnet/0.10/main.li
'--collect.info_schema.tables',
])
+ container.withEnv([{
name: 'DATA_SOURCE_NAME',
valueFrom: { secretKeyRef: { name: this.secret.metadata.name, key: 'EXPORTER_DATA_SOURCE_NAME' } },
name: 'MYSQLD_EXPORTER_PASSWORD',
valueFrom: { secretKeyRef: { name: this.secret.metadata.name, key: 'MYSQL_EXPORTER_PASSWORD' } },
}])
+ container.withPorts([
port.new('metrics', 9104),
Expand Down

0 comments on commit d97561b

Please sign in to comment.