All Products
Search
Document Center

:Monitor a MySQL database

Last Updated:Dec 13, 2024

Managed Service for Prometheus actively pulls performance data from your MySQL database based on the specified parameters. This way, you can monitor the database in real time and flexibly analyze the monitoring data. This topic describes how to monitor a MySQL database.

Prerequisites

Container cluster

ECS instance

Alibaba Cloud service

Procedure

  1. Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.

  2. Click MySQL and set the parameters as prompted. The following tables describe the key parameters.

    Container cluster

    Parameter

    Description

    MySQL Address

    The endpoint of the database.

    MySQL Service Port

    The port number of the database. Example: 3306.

    MySQL Username

    The username and password of the database.

    Important

    To mitigate the risk of data breaches, we recommend that you do not use an administrator account. Instead, we recommend a dedicated MySQL account and assign only the necessary permissions. For more information, see and Create a MySQL user for Managed Service for Prometheus

    MySQL Password

    ECS instance

    Parameter

    Description

    MySQL Address

    The endpoint of the database.

    MySQL Service Port

    The port number of the database. Example: 3306.

    MySQL Username

    The username and password of the database.

    Important

    To mitigate the risk of data breaches, we recommend that you do not use an administrator account. Instead, we recommend a dedicated MySQL account and assign only the necessary permissions. For more information, see and Create a MySQL user for Managed Service for Prometheus

    MySQL Password

    Custom Labels

    Add tags to the metrics of the ECS instance. Then, you can monitor, manage, query, or analyze the metric data in a fine-grained manner when you use tools such as Grafana. For more information, see Add tags to the metrics of an ECS instance using a VPC.

    Note
    • A tag key cannot contain special characters used in the Prometheus functionality, such as hyphens (-), periods (.), or percent signs (%).

    • Tags must be specified in the key-value format required by Prometheus.

    Alibaba Cloud service

    RDS Tag Keys: The RDS tag keys that you want to inject into the metrics.

View and manage the monitoring data of the MySQL database

The installed component is displayed on the Integration Management page in the Managed Service for Prometheus console. The Integration Management page consists of the Integrated Environments, Integrated Addons, and Query Dashboards tabs, where you can view information such as targets, metrics, dashboards, and alerts.

Targets

In the Targets section of the Self-Monitoring tab, you can view the list of targets discovered by the default jobs.

80.jpg

Metric Scraping

On the Metric Scraping tab, you can view or discard metrics. For more information, see Discard metrics.

79.jpg

Dashboards

In the Dashboards section of the Component Management tab, you can click a dashboard name to go to Grafana and view more dashboard data.

78.jpg

Alert Rule

In the Alert Rule section of the Component Management tab, you can view the alert rules of the MySQL database. For information about how to create alert rules, see Create an alert rule for a Prometheus instance.

77.jpg

References