Skip to content

Conversation

@mattlord
Copy link
Collaborator

@mattlord mattlord commented Dec 2, 2025

The operator was stuck on an old version (v0.14.0) of the mysqld_exporter because in v0.15.0 — which is 2.5 years old now — they removed the DATA_SOURCE_NAME environment variable that the operator used to specify how to connect to the mysqld container.

When upgrading the mysqld_exporter to v0.18.0 on main the vttablet pods fail to come up because of the noted issue:

❯ kubectl -n example logs example-vttablet-zone1-0790125915-4e37d9d5 -c mysqld-exporter
time=2025-12-04T03:35:38.702Z level=INFO source=mysqld_exporter.go:256 msg="Starting mysqld_exporter" version="(version=0.18.0, branch=HEAD, revision=4df239645fa28c4ed811fd697e42f7178d81e999)"
time=2025-12-04T03:35:38.702Z level=INFO source=mysqld_exporter.go:257 msg="Build context" build_context="(go=go1.25.1, platform=linux/arm64, user=root@6f5155465331, date=20250929-08:50:39, tags=unknown)"
time=2025-12-04T03:35:38.702Z level=ERROR source=config.go:145 msg="failed to validate config" section=client err="no user specified in section or parent"
time=2025-12-04T03:35:38.702Z level=ERROR source=config.go:145 msg="failed to validate config" section=mysqld err="no user specified in section or parent"
time=2025-12-04T03:35:38.702Z level=INFO source=mysqld_exporter.go:261 msg="Error parsing host config" file=/vt/vtdataroot/vt_0790125915/my.cnf err="no configuration found"

This PR enables support of v0.15.0 and later of the mysqld_exporter by using a standard MySQL my.cnf file which will work with any version of the exporter or any other client more broadly. We also then upgrade the version of the mysqld_exporter that we bundle and test with from v0.14.0 to the latest release: v0.18.0.

Fixes: #696

@mattlord mattlord added bug Something isn't working enhancement New feature or request labels Dec 2, 2025
@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from c1a590e to 95e1a40 Compare December 2, 2025 21:11
@mattlord mattlord requested a review from frouioui December 2, 2025 21:11
@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from 95e1a40 to e9cf734 Compare December 3, 2025 17:03
@mattlord
Copy link
Collaborator Author

mattlord commented Dec 3, 2025

@bluecrabs007 am I missing something here? The test updates also pass on main, so I'm not sure about things now...

./test/endtoend/backup_restore_test.sh
...

Confirming that the mysqld_exporter is working in example-vttablet-zone1-0790125915-4e37d9d5
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 6
Confirming that the mysqld_exporter is working in example-vttablet-zone1-2469782763-bfadd780
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 5
Confirming that the mysqld_exporter is working in example-vttablet-zone1-2548885007-46a852d0
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 6
...

@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from f02ccfb to 7e36c4d Compare December 3, 2025 20:58
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from 7e36c4d to 657ca0a Compare December 3, 2025 22:01
@bluecrabs007
Copy link

@bluecrabs007 am I missing something here? The test updates also pass on main, so I'm not sure about things now...

./test/endtoend/backup_restore_test.sh
...

Confirming that the mysqld_exporter is working in example-vttablet-zone1-0790125915-4e37d9d5
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 6
Confirming that the mysqld_exporter is working in example-vttablet-zone1-2469782763-bfadd780
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 5
Confirming that the mysqld_exporter is working in example-vttablet-zone1-2548885007-46a852d0
Confirmed working mysqld_exporter metrics: mysql_global_status_open_files = 6
...

Was the exporter version bumped to 0.18.0?

@mattlord
Copy link
Collaborator Author

mattlord commented Dec 4, 2025

Was the exporter version bumped to 0.18.0?

Aha! Thanks 😄

pkg/apis/planetscale/v2/defaults.go:    MysqldExporter: "prom/mysqld-exporter:v0.14.0",
test/endtoend/operator/101_initial_cluster.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/101_initial_cluster_autoscale.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/101_initial_cluster_backup.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/101_initial_cluster_backup_schedule.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/101_initial_cluster_unmanaged_tablet.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/101_initial_cluster_vtorc_vtadmin.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/102_keyspace_teardown.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/201_customer_tablets.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/302_new_shards.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/306_down_shard_0.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/401_scheduled_backups.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/cluster_autoscale.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0
test/endtoend/operator/cluster_upgrade.yaml:    mysqldExporter: prom/mysqld-exporter:v0.14.0

@mattlord mattlord changed the title Enable the mysqld_exporter without any required user changes Enable the v0.18.0 and later mysqld_exporter without any required user changes Dec 4, 2025
@mattlord mattlord changed the title Enable the v0.18.0 and later mysqld_exporter without any required user changes Enable support for the v0.18.0 and later mysqld_exporter Dec 4, 2025
@mattlord mattlord changed the title Enable support for the v0.18.0 and later mysqld_exporter Enable support for the v0.15.0 and later mysqld_exporter Dec 4, 2025
@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from c3ca285 to d110440 Compare December 4, 2025 03:30
@mattlord mattlord marked this pull request as ready for review December 4, 2025 03:39
@mattlord mattlord changed the title Enable support for the v0.15.0 and later mysqld_exporter Enable support for v0.15.0 and later mysqld_exporter Dec 4, 2025
Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord force-pushed the mysqld_exporter_dsn branch from d110440 to a74d308 Compare December 4, 2025 05:18
@mattlord
Copy link
Collaborator Author

mattlord commented Dec 4, 2025

@bluecrabs007 anything else you'd like to see changed or added? Thanks again for all of the help!

@bluecrabs007
Copy link

@bluecrabs007 anything else you'd like to see changed or added? Thanks again for all of the help!

Thank you! The changes look good.
I am assuming we are leaving the DATA_SOURCE_NAME ENV for backwards compatibility?

Name: "DATA_SOURCE_NAME",

@mattlord
Copy link
Collaborator Author

mattlord commented Dec 5, 2025

Thank you! The changes look good.

❤️

I am assuming we are leaving the DATA_SOURCE_NAME ENV for backwards compatibility?

Yeah, I figured we can leave it in there just to be backwards compatible too. It doesn't hurt anything.

@mattlord mattlord merged commit 839329a into main Dec 5, 2025
12 checks passed
@mattlord mattlord deleted the mysqld_exporter_dsn branch December 5, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DATA_SOURCE_NAME is no longer supported for mysqld_exporter

4 participants