File-controlled scrapers that can run arbitrary queries #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds
--extras.file
and--extras.refresh-interval
tomysqld_exporter
in order to allow easy addition of arbitrary metric-gathering queries without restartingmysqld
or worse.Usage:
When scraped, these metrics will be among the output:
The YAML file is not intended to be stuffed in the filesystem and forgotten about. Instead, it should be served via a Kubernetes config map. To update the metrics and queries that it scrapes, update the config map and wait longer than about the
--extras.refresh-interval
plus one minute (empirically how long config map updates take to become visible).ENOENT and EOF on the
--extras.file
are not considered errors. It might exist next time! This also means that deleting or emptying the file is a valid way to stop collecting these metrics.Post merge, here's what comes next: