Use Managed Service for Prometheus to collect performance metrics from your MongoDB database, letting you monitor its health in real time and analyze its performance data.
Prerequisites
Container cluster
-
Activate Managed Service for Prometheus. For more information, see Prometheus instance billing.
-
Create a Kubernetes cluster. For more information, see Create an ACK managed cluster.
-
Activate Alibaba Cloud Resource Center. For more information, see Activate Resource Center.
ECS (VPC)
-
You have activated Managed Service for Prometheus. For more information, see Billing of Prometheus instances.
-
You have created an ECS instance. For more information, see Create and use an ECS instance in the console (Express mode).
-
You have enabled Alibaba Cloud Resource Center. For more information, see Enable Resource Center.
Integrate with MongoDB
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.
Click the MongoDB card and follow the on-screen instructions to set up the integration. The following tables describe the key parameters.
Container cluster
Parameter
Description
MongoDB host
The endpoint of your MongoDB service. The following types of endpoints are supported:
The in-cluster endpoint of your MongoDB service. Example:
mongodb-server.namespace.The internal IP address of the cluster where your service is deployed.
The public IPv4 address of your service.
MongoDB port
The port of your MongoDB service. Example: 27017.
MongoDB username
The username for your MongoDB service.
MongoDB password
The password for your MongoDB service.
Metric collection interval (seconds)
The interval for collecting monitoring data. The default value is 15.
ECS (VPC)
Parameter
Description
MongoDB host
The endpoint of your MongoDB service. The following types of endpoints are supported:
The in-cluster endpoint of your MongoDB service. Example:
mongodb-server.namespace.The internal IP address of the cluster where your service is deployed.
The public IPv4 address of your service.
MongoDB port
The port of your MongoDB service. Example: 27017.
MongoDB username
The username for your MongoDB service.
MongoDB password
The password for your MongoDB service.
Metric collection interval (seconds)
The interval for collecting monitoring data. The default value is 15.
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 custom tags to ECS instance metrics in a VPC.
NoteA 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.
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.
Related documents
After you set up the integration, you can view monitoring data on a dashboard. For more information, see View Grafana dashboards.
After you set up the integration, you can create alert rules for key metrics to promptly detect and address anomalies in real time. For more information, see Create alert rules for a Prometheus instance.