Skip to content

Conversation

@stankevich
Copy link
Contributor

@stankevich stankevich commented Oct 25, 2024

Adds a new mysqldExporter.extraFlags property that can be used to pass custom flags to mysqld_exporter to enable/configure additional collectors. Also, makes it possible to override the collect.info_schema.tables.databases value if needed. The default behaviour and collector flags remain unchanged.

This PR largely follows existing code conventions in the operator. I added a new FormatArgsConvertBoolean() method to Flags to support mysqld_exporter's flag format. Added the tests for it and for the existing FormatArgs() and Merge() methods.

Closes #470.

@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch from bc29ff4 to eac877c Compare October 25, 2024 12:04
@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch 3 times, most recently from 3f26d14 to 4f78932 Compare November 8, 2024 16:03
@stankevich
Copy link
Contributor Author

Thanks for the helpful pointers, @frouioui! I regenerated the operator.yaml file and updated the tests to verify the exporter flags during an upgrade. I also made mysqldExporter.resources optional, otherwise it wasn't possible to provide extraFlags without also providing resources.

The upgrade test is passing locally, but is failing in CI. Unfortunately, I'm not able to see the reason. I noticed that the post-upgrade verifyVtGateVersion sometimes fails due to a race condition caused by upgrade-related pod restarts. I have ideas on improving this, but won't be able to contribute in the next couple of weeks.

verifyDurabilityPolicy "commerce" "semi_sync"
upgradeToLatest
verifyVtGateVersion "22.0.0"
verifyResourceSpec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: once the next release (v2.15.0) is out, we should do that check before and after we upgrade.

Copy link
Member

@frouioui frouioui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Thanks for working on that ❤️

@frouioui
Copy link
Member

frouioui commented Nov 11, 2024

The upgrade test is passing locally, but is failing in CI. Unfortunately, I'm not able to see the reason. I noticed that the post-upgrade verifyVtGateVersion sometimes fails due to a race condition caused by upgrade-related pod restarts. I have ideas on improving this, but won't be able to contribute in the next couple of weeks.

These tests are unfortunately pretty flaky indeed 😢 Hopefully we get some time to work on this.

@frouioui frouioui force-pushed the support-extra-flags-in-mysqld-exporter branch 2 times, most recently from fdc713e to 4f78932 Compare November 11, 2024 19:10
@frouioui
Copy link
Member

Merged main into the branch on the last push, hoping this will alleviate some of the flakiness.

@frouioui
Copy link
Member

Still flaky/failing. I added a retry mechanism to the verify vtgate version function. Hopefully that should help.

Signed-off-by: Sergey Stankevich <[email protected]>
Signed-off-by: Sergey Stankevich <[email protected]>
It's possible that mysqldExporter.extraFlags are provided while
mysqldExporter.resources are not.

Signed-off-by: Sergey Stankevich <[email protected]>
@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch 3 times, most recently from d56e0ac to 30fd381 Compare June 16, 2025 07:57
@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch from 30fd381 to 9b78217 Compare June 16, 2025 08:28
@stankevich
Copy link
Contributor Author

@frouioui: I rebased this PR and opened a new one in the Vitess repository since the previous one got closed: vitessio/vitess#18364.

Thanks!

@stankevich
Copy link
Contributor Author

@frouioui: Can this + vitessio/vitess#18364 be merged, or is there anything else that needs to be done?

@GuptaManan100 GuptaManan100 merged commit 071f5d3 into planetscale:main Jul 1, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow enabling additional mysqld_exporter collectors

4 participants