This topic describes how to create a Prometheus instance for ECS (Prometheus instance for ECS). The instance allows you to monitor an Elastic Compute Service (ECS) instance that resides in a virtual private cloud (VPC) by using Managed Service for Prometheus. This topic also describes how to create a dashboard to view the performance metrics of the ECS instance.

Prerequisites

Create a Prometheus instance

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Prometheus Service > Prometheus Instances.
  3. Click Create Prometheus Instance. On the page that appears, click Prometheus Instance for ECS.
  4. In the panel that appears, find the VPC for which you want to enable Managed Service for Prometheus and click Install in the Actions column.
    Note In the Integrate ECS Cluster (VPC) panel, a list of all VPCs in the current region is displayed.
  5. In the dialog box that appears, enter the name of the created Prometheus instance, select a vSwitch, security group, and Grafana workspace, and then click OK.
    • vSwitch: Select the vSwitch where the ECS instance to be monitored resides.
    • Security Group: Select the security group to which the ECS instance to be monitored belongs.
    • Grafana Workspace: Select the Grafana workspace where the monitoring data is displayed. You can click Create next to the Grafana Workspace field to create a Grafana workspace.
    After the Prometheus agent is installed, Installed is displayed in the Status column of the VPC. In addition, the created Prometheus instance is displayed on the Prometheus Service page and Prometheus for ECS is displayed in the Instance Type column.

Create a dashboard to view the performance metrics of the ECS instance

After you connect the ECS instance to Managed Service for Prometheus, you can create a Grafana dashboard to view the performance metrics of the ECS instance.

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Prometheus Service > Prometheus Instances.
  3. Click the name of the Prometheus instance that you want to manage. In the left-side navigation pane of the page that appears, click Dashboards.
  4. In the upper-right corner of the Dashboards page, click Create Dashboard in Grafana Service Pro Edition.
  5. Create a dashboard in the Grafana console based on your business requirements. For more information, see the Grafana documentation.

Stop monitoring the ECS instance

To stop using Managed Service for Prometheus to monitor the ECS instance, you can use one of the following methods to uninstall the Prometheus agent and delete the Prometheus instance for ECS.

Method 1:

On the Prometheus Service page, find the Prometheus instance that you want to uninstall and click Uninstall in the Actions column. In the message that appears, click OK. After you uninstall a Prometheus instance, it is no longer displayed on the Prometheus Service page.

Method 2

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Prometheus Service > Prometheus Instances.
  3. Click Create Prometheus Instance. On the page that appears, click Prometheus Instance for ECS.
  4. In the panel that appears, find the VPC and click Uninstall in the Actions column. In the dialog box that appears, click OK.
    After the Prometheus agent is uninstalled, Uninstalled is displayed in the Status column of the VPC. The Prometheus instance is no longer displayed on the Prometheus Service page.