OpenTelemetry Support
...
Service Integration Guides
MySQL Monitoring

MYSQL integration with KloudMate

10min

The MySQL integration provides almost real-time health and performance metrics for your MySQL database. You can visualize these metrics with the included dashboard and set up alerts to inform your team about different MySQL conditions.

This example demonstrates how to use OpenTelemetry and KloudMate to monitor MySQL performance, establish baseline metrics, and proactively address performance issues, ensuring optimal operation of your MySQL database.

Pre-requisites:

  1. MySQL installed and running
  2. Install the OpenTelemetry collector on the specific server that requires monitoring. Check Installing and Configuring OpenTelemetry Collector.
  3. MySQL username and password for authentication.
  4. The MySQL logs must be enabled from configurations.

Step 1: Configure the Receivers to scrape metrics as well as Logs.

To start monitoring MySQL with Otel Collector, you need to configure mysql receiver

  • Linux Users: Open the file located at /etc/otelcol-contrib/config.yaml using your preferred text editor.
  • Windows Users: Create a new file called config.yaml in the C:\Program Files\OpenTelemetry Collector folder. You can use Notepad or any text editor to do this.

Add the suitable extensions :

YAML
ļ»æ

In this step, two receivers are integrated to retrieve telemetry data from MySQL.

  • MySQL Receiver: To retrieve metrics
  • File Log Receiver: To retrieve logs

To get the metrics use only Mysql receiver

YAML
ļ»æ

Step 2: Set up the processor component to identify resource information from the host and either append or replace the resource values in the telemetry data with this information.

Please choose one of the following options for configuration based on your provider (AWS EC2, Azure VM or on-premises server).

  • Server(Can be on-premise, non-cloud or cloud)
YAML
ļ»æ
  • AWS EC2:

(optional)

To retrieve AWS EC2 instance tags along with logs and metrics, users need to associate an IAM role with the EC2 instance that includes the EC2:DescribeTags policy.

YAML
ļ»æ
  • Azure Virtual Machines:
YAML
ļ»æ

Step 3: Configure the exporter, extension and save the configuration

Set up the KloudMate Backend on the exporter part of the Open Telemetry configuration file and configure the pipeline.

YAML
ļ»æ

Step 4: To restart and verify the status of the OpenTelemetry (Otel) Collector, follow these steps:

For Linux:

  1. Execute the following commands:
Text
ļ»æ

These commands will restart the Otel Collector and display its current status.

For Windows:

  1. Open the Services window:
    • Press Win + R, type services.msc, and press OK.
    • Alternatively, search for "Services" in the Windows Start menu.
  2. In the Services window, locate the "OpenTelemetry Collector" service.
  3. Right-click the service and select "Restart."

Subsequently, monitor the metrics on the KloudMate dashboard and set up an alarm to receive notifications if the potential metrics for a specific application rise.

Document image
ļ»æ

Metric Name

Description

mysql.operations

Total operations including fsync, reads and writes

mysql_buffer_pool.data_pages

Number of data pages for an InnoDB buffer pool

mysql_buffer_pool.limit

Configured size of the InnoDB buffer pool

mysql_buffer_pool.operations

Number of operations on the InnoDB buffer pool

mysql_buffer_pool.page_flushes

Sum of Requests to flush pages for the InnoDB buffer pool

mysql_mysqlx_connections

Total MySQLx connections

mysql.tmp_resources

Number of temporary resources created

mysql_uptime

Number of seconds since the server has been up

mysql_index_io_wait_count

Total time of I/O wait events for a particular index

mysql_handlers

Number of requests to various MySQL handlers

mysql_locks

Total MySQL locks

mysql_log_operations

Number of InnoDB log operations

mysql.index.io.wait.time

Total time of I/O wait events for a particular index

mysql_row_locks

Total InnoDB row locks present

mysql_buffer_pool_usage

Number of bytes in the InnoDB buffer pool

mysql.page_operations

Total operation on InnoDB pages

mysql.double_writes

Number of writes to the InnoDB doublewrite buffer pool

mysql.table.io.wait.count

Total I/O wait events for a specific table

mysql.table.io.wait.time

Total wait time for I/O events for a table

mysql.prepared_statements

Number of times each type of Prepared statement command got issued

mysql.sorts

Total MySQL sort execution

mysql.row_operations

Total row operations executed

mysql.threads

Current state of MySQL threads

mysql.opened_resources

Total opened resources

mysql.buffer_pool.pages

Sum of pages in the InnoDB buffer pool

ļ»æ