The MySQL Integration allows you to ingest and monitor the performance and health metrics of your relational database management system (RDBMS) data. This integration is useful for identifying top SQL operations by row, tallying total requests to MySQL handlers, and tracking worker thread count.

Prerequisites

Middleware Host Agent (MW Agent) must be installed on your local machine. To install the MW Agent, see our Installation Guide.

Setup

Step 1: Create Database Credentials

Create a .yaml file containing database credentials like the below example. If the database is not password protected, the username and password fields can be removed.

/home/ubuntu/mysql-creds.yaml

.yaml
mysql:
    endpoint: localhost:3306
    username: mysql  
    password: mysql 

For Docker users, create the credentials yaml file in the /var/log directory.

Step 2: Access Integrations

Log in to Middleware, navigate to the Installations Page in the bottom left corner, select All Integration and click MySQL

Step 3: Enable Integration

Add a host machine from the dropdown list, input the credential path from Step 1, and Save

Visualize Analytics

Default MySQL Dashboard

Once the MySQL integration setup is complete, a new MySQL-specific dashboard will appear in the Dashboard Builder. This default dashboard serves as a jumping off point for visualizing and analyzing MySQL data.

Create MySQL Widget

MySQL data can be added to dashboards as a custom widget. When adding a new widget, select the mysql data source to view a full list of available MySQL data.

Alerts

Alerts can be configured for any MySQL metrics. When creating a new rule select the Database detection method and MySQL database type for available metrics to appear in the Metrics dropdown list. Select the desired metric and continue configuring the alert conditions.

Metrics Collected

MetricDescription
mysql.buffer_pool.pagesNumber of pages in the InnoDB buffer pool
mysql.buffer_pool.data_pagesNumber of data pages in the InnoDB buffer pool
mysql.buffer_pool.page_flushesNumber of requests to flush pages from the InnoDB buffer pool
mysql.buffer_pool.operationsNumber of operations on the InnoDB buffer pool
mysql.buffer_pool.limitConfigured size of the InnoDB buffer pool
mysql.buffer_pool.usageNumber of bytes in the InnoDB buffer pool
mysql.commandsCount of commands executed, per command type
mysql.prepared_statementsCount of prepared statements executed, per statement type
mysql.handlersNumber of requests to MySQL handlers
mysql.double_writesNumber of writes to the InnoDB doublewrite buffer
mysql.log_operationsNumber of InnoDB log operations
mysql.operationsNumber of InnoDB operations
mysql.page_operationsNumber of InnoDB page operations
mysql.table.io.wait.countTotal count of I/O wait events for a table
mysql.table.io.wait.timeTotal time of I/O wait events for a table
mysql.index.io.wait.countTotal count of I/O wait events for an index
mysql.index.io.wait.timeTotal time of I/O wait events for an index
mysql.row_locksNumber of InnoDB row blocks
mysql.row_operationsNumber of InnoDB row operations
mysql.locksNumber of MySQL locks
mysql.sortsNumber of MySQL sorts
mysql.threadsState of MySQL threads
mysql.locked_connectsNumber of attempts to connect to locked user accounts
mysql.opened_resourcesNumber of opened resources
mysql.mysqlx_connectionsNumber of mysqlx connections
mysql.tmp_resourcesNumber of created temporary resources
mysql.table.lock_wait.read.countCount of lock wait read events
mysql.table.lock_wait.read.timeTotal lock wait read event time
mysql.table.lock_wait.write.countCount of lock wait write events
mysql.table.lock_wait.write.timeTotal lock wait write event time
mysql.locked_connectsNumber of attempts to connect to locked user accounts
mysql.connection.countTotal number of connection attempts to the MySQL server (includes successful and unsuccessful attempts)
mysql.connection.errorsClient connection process errors
mysql.mysqlx_connectionsNumber of mysqlx connections
mysql.joinsNumber of joins that perform table scans
mysql.replica.time_behind_sourceActual replica delay, in seconds
mysql.replica.sql_delayConfigured replica delay, in seconds
mysql.statement_event.countCount of statement events
mysql.statement_event.wait.timeTotal wait time of summarized timed events
mysql.mysqlx_worker_threadsNumber of worker threads available
mysql.table_open_cacheTotal number of hits, misses, and overflows for open table cache lookups
mysql.query.client.countNumber of client statements executed by the server
mysql.query.countTotal number of statements executed by the server
mysql.query.slow.countNumber of slow queries

Troubleshooting

Next Steps

Need assistance or want to learn more about Middleware? Contact us at support[at]middleware.io.