ci: publish images to GHCR and bump promci to v0.8.2 (#1031)
Add packages: write permission and ghcr_io_password to the publish_main and publish_release jobs so images are pushed to GHCR alongside Docker Hub and Quay. Bump promci to v0.8.2, which performs its own checkout, so the standalone actions/checkout steps feeding the promci build/publish composites are removed.
Signed-off-by: Julien Pivotto 291750+roidelapluie@users.noreply.github.com
MySQL Server Exporter
Prometheus exporter for MySQL server metrics.
Supported versions:
NOTE: Not all collection methods are supported on MySQL/MariaDB < 5.6
Building and running
Required Grants
NOTE: It is recommended to set a max connection limit for the user to avoid overloading the server with monitoring scrapes under heavy load. This is not supported on all MySQL/MariaDB versions; for example, MariaDB 10.1 (provided with Ubuntu 18.04) does not support this feature.
Build
Running
Single exporter mode
Running using
.my.cnffrom the current directory:Multi-target support
This exporter supports the multi-target pattern. This allows running a single instance of this exporter for multiple MySQL targets.
To use the multi-target functionality, send an http request to the endpoint
/probe?target=foo:3306where target is set to the DSN of the MySQL instance to scrape metrics from.To avoid putting sensitive information like username and password in the URL, you can have multiple configurations in
config.my-cnffile and match it by adding&auth_module=<section>to the request.Sample config file for multiple configurations
On the prometheus side you can set a scrape config as follows
Flag format
Example format for flags for version > 0.10.0:
Example format for flags for version <= 0.10.0:
Collector Flags
pt-heartbeatis called with--utc). (default: false)*‘ for all.General Flags
host:port. (default:localhost:3306)~/.my.cnf)Environment Variables
Configuration precedence
If you have configured cli with both
mysqldflags and a valid configuration file, the options in the configuration file will override the flags forclientsection.TLS and basic authentication
The MySQLd Exporter supports TLS and basic authentication.
To use TLS and/or basic authentication, you need to pass a configuration file using the
--web.config.fileparameter. The format of the file is described in the exporter-toolkit repository.Customizing Configuration for a SSL Connection
If The MySQL server supports SSL, you may need to specify a CA truststore to verify the server’s chain-of-trust. You may also need to specify a SSL keypair for the client side of the SSL connection. To configure the mysqld exporter to use a custom CA certificate, add the following to the mysql cnf file:
To specify the client SSL keypair, add the following to the cnf.
Using Docker
You can deploy this exporter using the prom/mysqld-exporter Docker image.
For example:
heartbeat
With
collect.heartbeatenabled, mysqld_exporter will scrape replication delay measured by heartbeat mechanisms. Pt-heartbeat is the reference heartbeat implementation supported.Filtering enabled collectors
The
mysqld_exporterwill expose all metrics from enabled collectors by default. This is the recommended way to collect metrics to avoid errors when comparing metrics of different families.For advanced use the
mysqld_exportercan be passed an optional list of collectors to filter metrics. Thecollect[]parameter may be used multiple times. In Prometheus configuration you can use this syntax under the scrape config.This can be useful for having different Prometheus servers collect specific metrics from targets.
Example Rules
There is a set of sample rules, alerts and dashboards available in the mysqld-mixin