MySQL Moduleedit

This module periodically fetches metrics from MySQL servers.

Module-Specific Configuration Notesedit

When configuring the hosts option, you must use a MySQL Data Source Name (DSN) of the following format:


You can also separately specify the username and password using the respective configuration options. Usernames and passwords specified in the DSN take precedence over those specified in the username and password config options.

- module: mysql
  metricsets: ["status"]
  hosts: ["tcp("]
  username: root
  password: secret


The mysql MetricSets were tested with mysql 5.7.12 and are expected to work with all versions >= 5.7.0.

Example Configurationedit

The MySQL module supports the standard configuration options that are described in Modules Configuration. Here is an example configuration:

- module: mysql
  metricsets: ["status"]
  enabled: true
  period: 10s

  # Host DSN should be defined as "user:pass@tcp("
  # The username and password can either be set in the DSN or using the username
  # and password config options. Those specified in the DSN take precedence.
  hosts: ["root:secret@tcp("]


The following metricsets are available: