Skip to content

MySQL / MariaDB

Auto-Detection
Built-in Metrics
Logs
Tutorial available How to use Bleemeo for a MySQL monitoring
Read the tutorial

MySQL and MariaDB are widely used open-source relational database management systems.

Glouton detects MySQL and MariaDB by their process and listening port (default: 3306).

To enable metrics gathering, credentials are required. Glouton finds them automatically if:

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

If auto-detected parameters are incorrect, override them manually:

Terminal window
sudo tee /etc/glouton/conf.d/99-mysql.conf > /dev/null << 'EOF'
service:
# For a MySQL or MariaDB running outside a container
- type: "mysql"
username: "USERNAME"
password: "PASSWORD"
address: "127.0.0.1"
# If set to an existing socket file, Glouton will prefer the Unix socket
# for gathering metrics. 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"
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
EOF

Glouton automatically detects configuration changes.

Metric Description
service_status Status of MySQL or MariaDB
mysql_cache_result_qcache_hits Number of query cache hits per second
mysql_cache_result_qcache_inserts Number of queries added to the query cache per second
mysql_cache_result_qcache_not_cached Number of uncacheable queries per second
mysql_cache_result_qcache_prunes Number of queries deleted from the query cache due to low memory per second
mysql_cache_blocksize_qcache Number of blocks in the query cache
mysql_cache_free_blocks Number of free memory blocks in the query cache
mysql_cache_free_memory Free memory for the query cache in bytes
mysql_cache_size_qcache Number of queries registered in the query cache
mysql_locks_immediate Number of table locks granted immediately per second
mysql_locks_waited Number of table locks that required waiting per second
mysql_innodb_history_list_len Size of the InnoDB transaction history list
mysql_innodb_locked_transaction Number of currently locked InnoDB transactions
mysql_octets_rx Network traffic received from clients in bytes per second
mysql_octets_tx Network traffic sent to clients in bytes per second
mysql_queries Number of queries per second
mysql_slow_queries Number of slow queries per second
mysql_threads_cached Number of threads in the thread cache
mysql_threads_connected Number of currently open connections
mysql_threads_running Number of threads that are not sleeping
mysql_total_threads_created Number of threads created per second
mysql_commands_begin Number of "BEGIN" statements executed per second
mysql_commands_binlog Number of "BINLOG" statements executed per second
mysql_commands_call_procedure Number of "CALL PROCEDURE" statements executed per second
mysql_commands_change_master Number of "CHANGE MASTER" statements executed per second
mysql_commands_change_repl_filter Number of "CHANGE REPL FILTER" statements executed per second
mysql_commands_check Number of "CHECK TABLE" statements executed per second
mysql_commands_checksum Number of "CHECKSUM TABLE" statements executed per second
mysql_commands_commit Number of "COMMIT" statements executed per second
mysql_commands_dealloc_sql Number of "DEALLOCATE PREPARE" statements executed per second
mysql_commands_stmt_close Number of "DEALLOCATE PREPARE" statements executed per second
mysql_commands_delete_multi Number of multi-table "DELETE" statements executed per second
mysql_commands_delete Number of "DELETE" statements executed per second
mysql_commands_do Number of "DO" statements executed per second
mysql_commands_execute_sql Number of "EXECUTE" statements executed per second
mysql_commands_stmt_execute Number of "EXECUTE" statements executed per second
mysql_commands_explain_other Number of "EXPLAIN FOR CONNECTION" statements executed per second
mysql_commands_flush Number of "FLUSH" statements executed per second
mysql_commands_ha_close Number of "HA CLOSE" statements executed per second
mysql_commands_ha_open Number of "HA OPEN" statements executed per second
mysql_commands_ha_read Number of "HA READ" statements executed per second
mysql_commands_insert_select Number of "INSERT ... SELECT" statements executed per second
mysql_commands_insert Number of "INSERT" statements executed per second
mysql_commands_kill Number of "KILL" statements executed per second
mysql_commands_preload_keys Number of "LOAD INDEX INTO CACHE" statements executed per second
mysql_commands_load Number of "LOAD" statements executed per second
mysql_commands_lock_tables Number of "LOCK TABLES" statements executed per second
mysql_commands_optimize Number of "OPTIMIZE" statements executed per second
mysql_commands_prepare_sql Number of "PREPARE" statements executed per second
mysql_commands_stmt_prepare Number of "PREPARE" statements executed per second
mysql_commands_purge_before_date Number of "PURGE BEFORE DATE" statements executed per second
mysql_commands_purge Number of "PURGE" statements executed per second
mysql_commands_release_savepoint Number of "RELEASE SAVEPOINT" statements executed per second
mysql_commands_repair Number of "REPAIR" statements executed per second
mysql_commands_replace_select Number of "REPLACE SELECT" statements executed per second
mysql_commands_replace Number of "REPLACE" statements executed per second
mysql_commands_reset Number of "RESET" statements executed per second
mysql_commands_resignal Number of "RESIGNAL" statements executed per second
mysql_commands_rollback_to_savepoint Number of "ROLLBACK TO SAVEPOINT" statements executed per second
mysql_commands_rollback Number of "ROLLBACK" statements executed per second
mysql_commands_savepoint Number of "SAVEPOINT" statements executed per second
mysql_commands_select Number of "SELECT" statements executed per second
mysql_commands_signal Number of "SIGNAL" statements executed per second
mysql_commands_slave_start Number of "START SLAVE" statements executed per second
mysql_commands_group_replication_start Number of "START" for group replication statements executed per second
mysql_commands_stmt_fetch Number of "STMT FETCH" statements executed per second
mysql_commands_stmt_reprepare Number of "STMT REPREPARE" statements executed per second
mysql_commands_stmt_reset Number of "STMT RESET" statements executed per second
mysql_commands_stmt_send_long_data Number of "STMT SEND LONG DATA" statements executed per second
mysql_commands_slave_stop Number of "STOP SLAVE" statements executed per second
mysql_commands_group_replication_stop Number of "STOP" for group replication statements executed per second
mysql_commands_truncate Number of "TRUNCATE" statements executed per second
mysql_commands_unlock_tables Number of "UNLOCK TABLES" statements executed per second
mysql_commands_update_multi Number of multi-table "UPDATE" statements executed per second
mysql_commands_update Number of "UPDATE" statements executed per second
mysql_commands_xa_commit Number of "XA COMMIT" statements executed per second
mysql_commands_xa_end Number of "XA END" statements executed per second
mysql_commands_xa_prepare Number of "XA PREPARE" statements executed per second
mysql_commands_xa_recover Number of "XA RECOVER" statements executed per second
mysql_commands_xa_rollback Number of "XA ROLLBACK" statements executed per second
mysql_commands_xa_start Number of "XA START" statements executed per second
mysql_commands_assign_to_keycache Number of assign-to-keycache commands per second
mysql_handler_commit Number of internal commit requests per second
mysql_handler_delete Number of rows deleted from tables per second
mysql_handler_write Number of rows inserted per second
mysql_handler_update Number of rows updated per second
mysql_handler_rollback Number of transaction rollback requests given to a storage engine per second

Glouton collects MySQL and MariaDB logs for analysis in Bleemeo.