mysql.d/conf.yamlfile, in the
conf.d/folder at the root of your Agent's configuration directory to start collecting your MySQL metrics and logs.
stackstateuser with the native password hashing method:
@'localhost'is only for local connections - use the hostname/IP of your Agent for remote connections. For more information, see the MySQL documentation.
<UNIQUEPASSWORD>with the password you created above:
performance_schemadatabase by granting an additional privilege:
mysql.d/conf.yamlto collect your MySQL metrics:
extra_performance_metrics, your MySQL server must have
performance_schemaenabled - otherwise set
false. For more information on
performance_schema, see the MySQL documentation.
stackstateuser should be set up in the MySQL integration configuration as
host: 127.0.0.1instead of
localhost. Alternatively, you may also use
/var/log/syslogwhich requires root access to read. To make the logs more accessible, follow these steps:
/etc/mysql/conf.d/mysqld_safe_syslog.cnfand remove or comment the lines.
/etc/mysql/my.cnfand add following lines to enable general, error, and slow query logs:
service mysql restart
/var/log/mysqldirectory and all of the files within. Double-check your logrotate configuration to make sure those files are taken into account and that the permissions are correctly set there as well.
/etc/logrotate.d/mysql-serverthere should be something similar to:
mysql.d/conf.yamlfile to start collecting your MySQL logs:
mysql.yamlfor all available configuration options, including those for custom metrics.
statussubcommand and look for
mysqlunder the Checks section.
metadata.csvfor a list of metrics provided by this integration.
trueto enable the respective metrics:
extra_status_metricsadds the following metrics:
extra_innodb_metricsadds the following metrics:
extra_performance_metricsadds the following metrics:
schema_size_metricsadds the following metric:
mysql.replication.slave_running: Returns CRITICAL for a slave that's not running, otherwise OK.
mysql.can_connect: Returns CRITICAL if the Agent cannot connect to MySQL to collect metrics, otherwise OK.