Create metric import tasks to bring monitoring data from self-managed data centers into Cloud Monitor, and then visualize the data on dashboards.
Prerequisites
-
Cloud Monitor, your self-managed data center, and the middleware host can communicate with each other.
-
Create a namespace. For more information, see Create a namespace.
Create a metric import task
-
Install the Cloud Monitor agent on the host in your self-managed data center.
For more information, see Install and uninstall the Cloud Monitor agent.
-
Install an exporter for the middleware in your self-managed data center.
The following example uses Redis to demonstrate exporter installation.
ImportantYou can install the Cloud Monitor agent and exporters only by using an administrator account (the
rootuser for Linux or theAdministratoruser for Windows). However, using an administrator account may introduce certain risks, such as system instability or data security issues. Proceed with caution.-
Windows
-
Log on to the middleware host as an Administrator user.
-
Download the redis_exporter_win_amd64 installation package from the exporter download URL to any directory.
NoteIf you need to install an exporter for a different middleware, replace
redisin the download URL with the name of that middleware. -
Double-click redis_exporter_win_amd64 to install the exporter.
-
Verify the installation.
- Open the command prompt window.
Press Win+R. In the Run dialog box, enter cmd and click OK.
-
Run the following command to check the exporter status:
tasklist | findstr "redis"
If the following output is returned, the exporter is installed successfully.
redis_exporter_win_amd64. 4496 RDP-Tcp#37 3 7,924 K
- Open the command prompt window.
-
-
Linux
NoteIn the following commands, replace
rediswith the name of the target middleware.-
Log on to the middleware host as the root user.
-
Run the following command to download the exporter installation package:
wget https://cms-prometheus.oss-cn-hangzhou.aliyuncs.com//redis/redis_exporter_linux_amd64
-
Run the following command to make the redis_exporter_linux_amd64 file executable:
chmod +x redis_exporter_linux_amd64
-
Run the following command to rename the redis_exporter_linux_amd64 file to redis_exporter:
mv redis_exporter_linux_amd64 redis_exporter
-
Run the following command to install the exporter and start the service:
./redis_exporter -redis.addr localhost:6379 -web.listen-address localhost:9121
-
Run the following command to verify the installation:
ps -ef | grep "redis_exporter"
If the following output is returned, the exporter is installed successfully.
root 461050 460640 0 15:46 pts/0 00:00:00 ./redis_exporter -redis.addr localhost:6379 -web.listen-address localhost:9121 root 461166 461128 0 15:47 pts/5 00:00:00 grep --color=auto redis_exporter
-
-
-
Create the metric import task.
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.
-
Find the desired namespace and click the number of accounts, cloud services, metrics, or tasks in the Metric Data column.
NoteThis number is the total count of metric import tasks from sources such as on-premises data centers, AWS, Tencent Cloud, Prometheus, on-premises logs, and Simple Log Service (SLS).
-
On the Metric management panel, click the other IDC tab, and then click Metric Data.
-
On the Basic Task Information page of the Metric Data dialog box, configure the basic task parameters and click Next.
Parameter
Description
Select Middleware to Be Monitored
The middleware to monitor. Options: Spring, Tomcat, Nginx, Tengine, JVM, Redis, MySQL, and Others.
Custom Middleware
The name of the custom middleware.
Required when you select Others for Select Middleware to Be Monitored.
Task Name
The name of the metric import task.
Task Description
The description of the metric import task.
Select Host
Hosts in your self-managed data center that have the Cloud Monitor agent installed.
NoteThe Cloud Monitor agent must be installed on these hosts.
Region
The region where the host is located.
NoteClick Advanced Options to configure this parameter.
Network Type
The network type of the host. Valid values:
-
VPC
-
classic network
NoteClick Advanced Options to configure this parameter.
-
-
On the Data Access Check tab, confirm that the latest versions of the Cloud Monitor agent and the exporter are installed, then click Next.
-
On the Task Details tab, enter the URL of the collection target, select the collection interval and timeout, configure task tags, and then click Confirm.
-
On the Dashboard tab, click Close.
-
Modify a metric import task
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.
-
Find the desired namespace and click the number of accounts, cloud services, metrics, or tasks in the Metric Data column.
NoteThis number is the total count of metric import tasks from sources such as on-premises data centers, AWS, Tencent Cloud, Prometheus, on-premises logs, and Simple Log Service (SLS).
-
On the Metric management panel, click the other IDC tab. Find the task that you want to modify and click Modify in the Actions column.
-
On the Basic Task Information page of the Metric Data dialog box, modify the basic task parameters and click Next.
-
On the Data Access Check page, confirm the agent and exporter status, and then click Next.
-
On the Task Details page, modify the task details and click Confirm.
-
On the Dashboard page, click Close.
Delete a metric import task
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose Hybrid Cloud Monitoring > Namespace.
-
Find the desired namespace and click the number of accounts, cloud services, metrics, or tasks in the Metric Data column.
NoteThis number is the total count of metric import tasks from sources such as on-premises data centers, AWS, Tencent Cloud, Prometheus, on-premises logs, and Simple Log Service (SLS).
-
On the Metric management panel, click the other IDC tab. Find the task that you want to delete and click Delete in the Actions column.
-
Click Confirm in the Confirm deletion dialog box.