This topic describes how to use Managed Service for Prometheus to monitor a TiDB cluster.
Step 1: Enable the TiDB component
Go to the Integration Center page: Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.
Select the TiDB component: In the Database section of the Integration Center page, click TIDB.
Set the parameters: Set the parameters in the TIDB panel.
Parameter
Description
Select the environment type
Select the type of the environment in which the cluster resides. The following environment types are supported:
Container Service for Kubernetes (ACK) cluster
Elastic Compute Service (ECS) instance
Select a Kubernetes cluster
If the cluster resides in an ACK cluster, select the cluster.
Select VPC
If the cluster resides in an ECS instance, select the instance.
TIDB cluster name
Enter the name of the TiDB cluster.
NoteThe TiDB cluster name must be unique to prevent duplicate metric collection.
Namespace
The namespace where the TiDB cluster resides.
PD Server Container Name
Enter the names of the TiDB server, Placement Driver (PD) server, and TiKV server. Default names are automatically filled in.
TiDB Server Container Name
TiKV Server Container Name
PD Metrics Port
Specify the ports of the TiDB server, PD server, and TiKV server. Default ports are automatically filled in.
TiDB Metrics Port
TiKV Metrics Port
PD Metrics Collection Path
Specify the paths to which the monitoring data of the TiDB server, PD server, and TiKV server is collected. Default paths are automatically filled in.
TiDB Metrics Collection Path
TiKV Metrics Collection Path
Metric collection interval (unit/second)
The interval at which Managed Service for Prometheus collects the monitoring data. Default value: 30 seconds.
Step 2: View the Grafana dashboards
Go to the Integration Management page: In the left-side navigation pane, click Integration Management.
Select the environment: On the Integrated Environments tab of the Integration Management page, click the name of the ACK cluster or ECS instance.
Select the component: In the Addon Type section of the Component Management tab, click TIDB and then click Dashboards to view the dashboard list.
View a dashboard: Click the name of a dashboard.
Step 3: Configure alert rules for the TiDB cluster
View or modify the default alert rules: In the Addon Type section of the Component Management tab, click TIDB and then click Alert Rule to view or modify the default alert rules.
Add custom alert rules: Add custom alert rules based on your business requirements. For more information, see Prometheus alert rules.