Caution
Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
mysqld_exporter_config
The mysqld_exporter_config
block configures the mysqld_exporter
integration,
which is an embedded version of
mysqld_exporter
and allows for collection metrics from MySQL servers.
Note that currently, an Agent can only collect metrics from a single MySQL
server. If you want to collect metrics from multiple servers, run multiple
Agents and add labels using relabel_configs
to differentiate between the MySQL
servers:
mysqld_exporter:
enabled: true
data_source_name: root@(server-a:3306)/
relabel_configs:
- source_labels: [__address__]
target_label: instance
replacement: server-a
We strongly recommend that you configure a separate user for the Agent, and give it only the strictly mandatory security privileges necessary for monitoring your node, as per the official documentation.
Full reference of options:
The full list of collectors that are supported for mysqld_exporter
is: