Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support extra flags for mysqld_exporter #629

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

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
pkg/operator/vitess/flags_test.go Outdated Show resolved Hide resolved
pkg/operator/vitess/flags_test.go Show resolved Hide resolved
@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch 2 times, most recently from e395f17 to 3f26d14 Compare November 8, 2024 16:03
Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
It's possible that mysqldExporter.extraFlags are provided while
mysqldExporter.resources are not.

Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
Similar to checkPodStatusWithTimeout(), but uses selectors and checks
the pod spec for matches.

Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
Signed-off-by: Sergey Stankevich <stankevich@users.noreply.github.com>
@stankevich stankevich force-pushed the support-extra-flags-in-mysqld-exporter branch 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.

@@ -251,6 +260,7 @@ checkSemiSyncSetup
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.

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
@frouioui
Copy link
Member

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

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
3 participants