Skip to content

MySQL / MariaDB

Auto-Discovery
Health Check
Metrics
Logs

To enable metrics gathering, credentials are required. Bleemeo agent will find the credentials if:

  • MySQL or MariaDB and the agent are running on Ubuntu or Debian
  • MySQL or MariaDB is running in a Docker container and root password is set through the environment variable MYSQL_ROOT_PASSWORD or MARIADB_ROOT_PASSWORD

If some auto-detected parameters are wrong, you can manually override them by adding the following to /etc/glouton/conf.d/99-local.conf:

service:
[...]
# For a MySQL or MariaDB running outside a container
- type: "mysql"
username: "USERNAME"
password: "PASSWORD"
address: "127.0.0.1"
# If set to existing socket file, Glouton will prefer using the Unix socket to
# connect and gather metric from MySQL or MariaDB.
# Service check will continue to use the TCP address.
metrics_unix_socket: "/var/run/mysqld/mysqld.sock"
port: 3306
# For an additional MySQL or MariaDB running outside a container
- type: "mysql"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
username: "USERNAME"
password: "PASSWORD"
address: "127.0.0.1"
# If set to existing socket file, Glouton will prefer using the Unix socket to
# connect and gather metric from MySQL or MariaDB.
# Service check will continue to use the TCP address.
metrics_unix_socket: "/var/run/mysqld/mysqld2.sock"
port: 3307
# For a MySQL or MariaDB running in a Docker container
- type: "mysql"
instance: "CONTAINER_NAME"
username: "USERNAME"
password: "PASSWORD"
address: "172.17.0.2"
port: 3306

Agent gathers the following metrics:

MetricDescription
service_status: Status of MySQL or MariaDB
mysql_cache_result_qcache_hitsNumber of query cache hits per second
mysql_cache_result_qcache_insertsNumber of queries added to the query cache per second
mysql_cache_result_qcache_not_cachedNumber of uncacheable queries per second
mysql_cache_result_qcache_prunesNumber of queries that were deleted from the query cache because of low memory per second
mysql_cache_blocksize_qcacheNumber of blocks in the query cache
mysql_cache_free_blocksNumber of free memory blocks in the query cache
mysql_cache_free_memoryNumber of free memory for the query cache in bytes
mysql_cache_size_qcacheNumber of queries registered in the query cache
mysql_locks_immediateNumber of table locks that could be granted immediately per second
mysql_locks_waitedNumber of table locks that could not be granted immediately per second
mysql_innodb_history_list_lenSize of InnoDB transaction history list
mysql_innodb_locked_transactionNumber of InnoDB transaction currently locked
mysql_octets_rxNetwork traffic received from clients in bytes per second
mysql_octets_txNetwork traffic sent to clients in bytes per second
mysql_queriesNumber of queries per second
mysql_slow_queriesNumber of slow queries per second
mysql_threads_cachedNumber of threads in the thread cache
mysql_threads_connectedNumber of currently open connections
mysql_threads_runningNumber of threads that are not sleeping
mysql_total_threads_createdNumber of threads created per second
mysql_commands_beginNumber of “BEGIN” statement executed per second
mysql_commands_binlogNumber of “BINLOG” statement executed per second
mysql_commands_call_procedureNumber of “CALL PROCEDURE” statement executed per second
mysql_commands_change_masterNumber of “CHANGE MASTER” statement executed per second
mysql_commands_change_repl_filterNumber of “CHANGE REPL FILTER” statement executed per second
mysql_commands_checkNumber of “CHECK TABLE” statement executed per second
mysql_commands_checksumNumber of “CHECKSUM TABLE” statement executed per second
mysql_commands_commitNumber of “COMMIT” statement executed per second
mysql_commands_dealloc_sqlNumber of “DEALLOCATE PREPARE” statement executed per second
mysql_commands_stmt_closeNumber of “DEALLOCATE PREPARE” statement executed per second
mysql_commands_delete_multiNumber of “DELETE” on multiple table statement executed per second
mysql_commands_deleteNumber of “DELETE” statement executed per second
mysql_commands_doNumber of “DO” statement executed per second
mysql_commands_execute_sqlNumber of “EXECUTE” statement executed per second
mysql_commands_stmt_executeNumber of “EXECUTE” statement executed per second
mysql_commands_explain_otherNumber of “EXPLAIN FOR CONNECTION” statement executed per second
mysql_commands_flushNumber of “FLUSH” statement executed per second
mysql_commands_ha_closeNumber of “HA CLOSE” statement executed per second
mysql_commands_ha_openNumber of “HA OPEN” statement executed per second
mysql_commands_ha_readNumber of “HA READ” statement executed per second
mysql_commands_insert_selectNumber of “INSERT … SELECT” statement executed per second
mysql_commands_insertNumber of “INSERT” statement executed per second
mysql_commands_killNumber of “KILL” statement executed per second
mysql_commands_preload_keysNumber of “LOAD INDEX INTO CACHE” statement executed per second
mysql_commands_loadNumber of “LOAD” statement executed per second
mysql_commands_lock_tablesNumber of “LOCK TABLES” statement executed per second
mysql_commands_optimizeNumber of “OPTIMIZE” statement executed per second
mysql_commands_prepare_sqlNumber of “PREPARE” statement executed per second
mysql_commands_stmt_prepareNumber of “PREPARE” statement executed per second
mysql_commands_purge_before_dateNumber of “PURGE BEFORE DATE” statement executed per second
mysql_commands_purgeNumber of “PURGE” statement executed per second
mysql_commands_release_savepointNumber of “RELEASE SAVEPOINT” statement executed per second
mysql_commands_repairNumber of “REPAIR” statement executed per second
mysql_commands_replace_selectNumber of “REPLACE SELECT” statement executed per second
mysql_commands_replaceNumber of “REPLACE” statement executed per second
mysql_commands_resetNumber of “RESET” statement executed per second
mysql_commands_resignalNumber of “RESIGNAL” statement executed per second
mysql_commands_rollback_to_savepointNumber of “ROLLBACK TO SAVEPOINT” statement executed per second
mysql_commands_rollbackNumber of “ROLLBACK” statement executed per second
mysql_commands_savepointNumber of “SAVEPOINT” statement executed per second
mysql_commands_selectNumber of “SELECT” statement executed per second
mysql_commands_signalNumber of “SIGNAL” statement executed per second
mysql_commands_slave_startNumber of “START SLAVE” statement executed per second
mysql_commands_group_replication_startNumber of “START” for group replication statement executed per second
mysql_commands_stmt_fetchNumber of “STMT FETCH” statement executed per second
mysql_commands_stmt_reprepareNumber of “STMT REPREPARE” statement executed per second
mysql_commands_stmt_resetNumber of “STMT RESET” statement executed per second
mysql_commands_stmt_send_long_dataNumber of “STMT SEND LONG DATA” statement executed per second
mysql_commands_slave_stopNumber of “STOP SLAVE” statement executed per second
mysql_commands_group_replication_stopNumber of “STOP” for group replication statement executed per second
mysql_commands_truncateNumber of “TRUNCATE” statement executed per second
mysql_commands_unlock_tablesNumber of “UNLOCK TABLES” statement executed per second
mysql_commands_update_multiNumber of “UPDATE” on multiple table statement executed per second
mysql_commands_updateNumber of “UPDATE” statement executed per second
mysql_commands_xa_commitNumber of “XA COMMIT” statement executed per second
mysql_commands_xa_endNumber of “XA END” statement executed per second
mysql_commands_xa_prepareNumber of “XA PREPARE” statement executed per second
mysql_commands_xa_recoverNumber of “XA RECOVER” statement executed per second
mysql_commands_xa_rollbackNumber of “XA ROLLBACK” statement executed per second
mysql_commands_xa_startNumber of “XA START” statement executed per second
mysql_commands_assign_to_keycacheNumber of assign to keycache commands per second
mysql_handler_commitNumber of internal commit request per second
mysql_handler_deleteNumber of rows deleted from tables per second
mysql_handler_writeNumber of rows inserted per second
mysql_handler_updateNumber of rows updated per second
mysql_handler_rollbackNumber of transaction rollback requests given to a storage engine per second