You can create a metric import task to import data from Prometheus to CloudMonitor. After data is imported from Prometheus to CloudMonitor, you can create a dashboard to view the monitoring chart of a specific metric.
Prerequisites
A namespace is created. For more information, see Create a namespace.
Background information
Prometheus metric data is generated based on the monitoring data that Prometheus collects from third-party cloud services by using the CloudMonitor agent.
Create a metric import task
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
In the upper-left corner of the Prometheus Monitoring tab, click Metric Data.
On the Prometheus Metrics tab, configure the parameters. The following table describes the parameters.
Parameter
Description
Metric Type
The type of Prometheus metrics. Valid values: Custom Prometheus Metrics, Spring, Tomcat, Nginx, Tengine, JVM, Redis, and MySQL.
Task Name
The name of the metric import task for Prometheus.
Description
The description of the metric import task for Prometheus.
Application Groups
The application group to which the Prometheus data belongs.
Hosts
The rule that is used to match hosts from which Prometheus data is collected. Valid values:
All: collects Prometheus data from all instances.
All Rules: collects Prometheus data from the instances whose names meet all specified conditions.
Any Rule: collects Prometheus data from the instances whose names meet one of the specified conditions.
Collection Target
The URL of the destination from which Prometheus data is collected.
Collection Interval
The interval at which Prometheus data is collected. Valid values: 15 Seconds, 30 Seconds, and 60 Seconds.
Collection Timeout Period
The timeout period for collecting Prometheus data. Valid values: 15 Seconds, 30 Seconds, and 60 Seconds.
Namespace
The name of the namespace.
Tags
The tags of the metric. You can specify the key and value of each tag.
Agent Installation Confirmation
Make sure that a CloudMonitor agent is installed on the instances of the selected application group and the version of the agent is V3.5.5 or later. For information about how to install a CloudMonitor agent, see Install and uninstall the CloudMonitor agent for C++.
Click OK.
Modify a metric import task
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Prometheus Monitoring tab, find the metric import task that you want to modify and click Modify in the Actions column.
On the Prometheus Metrics tab, configure the parameters. The following table describes the parameters.
Parameter
Description
Task Name
The name of the metric import task for Prometheus.
Description
The description of the metric import task for Prometheus.
Hosts
The rule that is used to match hosts from which Prometheus data is collected. Valid values:
All: collects Prometheus data from all instances.
All Rules: collects Prometheus data from the instances whose names meet all specified conditions.
Any Rule: collects Prometheus data from the instances whose names meet one of the specified conditions.
Collection Target
The URL of the destination from which Prometheus data is collected.
Collection Interval
The interval at which Prometheus data is collected. Valid values: 15 Seconds, 30 Seconds, and 60 Seconds.
Collection Timeout Period
The timeout period for collecting Prometheus data. Valid values: 15 Seconds, 30 Seconds, and 60 Seconds.
Tags
The tags of the metric. You can specify the key and value of each tag.
Agent Installation Confirmation
Make sure that a CloudMonitor agent is installed on the instances of the selected application group and the version of the agent is V3.5.5 or later. For more information about how to install the CloudMonitor agent, see Install and uninstall the CloudMonitor agent for C++.
Click OK.
Delete a metric import task
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Prometheus Monitoring tab, find the metric import task that you want to delete, click the icon in the Actions column, and then click Delete.
In the Confirm deletion message, click Confirm.
Copy a metric import task
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Prometheus Monitoring tab, find the metric import task that you want to copy and click Copy in the Actions column.
On the Prometheus Metrics tab, configure the parameters.
By default, CloudMonitor runs the current metric import task based on the values that you specified for all parameters. You can modify the settings based on your business requirements.