Atatus Database Monitoring offers comprehensive insights into your MySQL databases, revealing key metrics such as query performance, query samples, execution plans, connection details, system statistics, and InnoDB storage engine telemetry. To enable Database Monitoring, the Agent gathers telemetry by accessing the database as a read-only user. Follow these steps to configure Database Monitoring for your MySQL database:

Before You Begin

Configure MySQL Performance Schema Settings

To gather query metrics, samples, and execution plans, you need to activate the MySQL Performance Schema and set up the required Performance Schema Options. This can be done through the command line or by adjusting the configuration files (e.g., mysql.conf):

Setup Database Access for the Agent

Create the atatus user and grant basic permissions:
Create the following schema:
Procedure to Enable Events Statements Consumers:
Create the EXPLAIN_STATEMENT procedure to enable the agent to collect explain plans.
Additionally, create this procedure in every schema from which you want to collect explain plans. Replace YOUR_SCHEMA with the appropriate schema name.
[Optional] To collect and visualize database configuration and schema details in MySQL, the Atatus user requires the following privileges. Use the SQL query below to grant the necessary permissions:

Configure Atatus Infrastructure Agent

  1. To enable Database Monitoring for your databases, You should install the Atatus Infrastructure agent in your host machine.
  2. Copy the mysql example configuration file.
  3. Update mysql Configuration File:
Add the following configuration to /etc/atatus-infra-agent/conf.d/mysql.d/mysql.yml:
  1. Restart the atatus infrastructure agent and MySQL service.

Collecting Schemas (Optional)

Starting from Agent v3.4.0, the Atatus Infra Agent supports collecting schema information from MySQL databases.
To enable this, configure the schemas_collection option in your agent settings.

Collecting Custom Metrics (Optional)

To collect custom metrics, use the custom_queries option in your configuration. Refer to the sample atatus-mysql.conf file for guidance.