After you activate Managed Service for Prometheus, you can view only the Prometheus instances that belong to your Alibaba Cloud account. However, if you have built a multi-account architecture for your enterprise by using a resource directory, you can use the management account of the resource directory to create global aggregation instances for other Alibaba Cloud accounts. This way, you can monitor Prometheus instances of multiple member accounts in a unified manner. This topic describes how to create a global aggregation instance across Alibaba Cloud accounts.

Prerequisites

  • The multi-account architecture of your enterprise is built by using a resource directory. For more information about resource directories, see Resource Directory overview.
  • A member in the resource directory is specified as a delegated administrator account. To do this, you must use the enterprise administrator account or a RAM role that has administrator permissions to call RegisterDelegatedAdministrator in OpenAPI Explorer. The following parameters are required:
    • Region: To configure a delegated administrator role in the Chinese mainland, select the China (Shanghai) region. Otherwise, select the Singapore region.
    • AccountId: Enter the user ID of the member account for which you want to create a global aggregation instance.
    • ServicePrincipal: Enter prometheus.aliyuncs.com.

Procedure

  1. Log on to the Managed Service for Prometheus console with the management account of the resource directory.
  2. In the left-side navigation pane, click Monitoring List.
  3. Click Create Prometheus Instance. On the page that appears, click Global Aggregation Instance.
  4. In the panel that appears, follow the instructions to enter the name of the global aggregation instance, select the endpoint, and then select Other accounts. Add a Prometheus instance of another member account in the resource directory. Then, click Create an aggregation instance.
    The created global aggregation instance is displayed on the Prometheus Monitoring page and Prometheus for GlobalView is displayed in the Instance Type column.
    Note
    • After you set the Select Instances to Aggregate parameter to Other accounts, Managed Service for Prometheus sets the trusted service status in the resource directory to Enabled.
    • When you configure the Endpoint parameter, select the region where you want to configure an alert rule. We recommend that you select the region with the largest number of instances. If you select another region, the access speed and system stability may be affected.
    • In the STEP3 section, you can select instances that reside in different regions. Before you select instances, you must specify an endpoint in the STEP2 section.
    • To edit a global aggregation instance, you can click Edit in the Actions column of the instance. If you change the endpoint, the alert rule configured for the original endpoint becomes invalid. Therefore, we recommend that you do not change the endpoint unless it is necessary.

View the metric data of the global aggregation instance on Grafana dashboards

After you create a global aggregation instance by using Managed Service for Prometheus, you can view the performance metrics of the global aggregation instance on built-in Grafana dashboards.

  1. On the Prometheus Monitoring page, click the name of the Prometheus instance. In the left-side navigation pane, click Dashboards.
  2. On the Dashboards page, click the name of a dashboard to view the performance metrics of the instance.

Create an alert rule for the global aggregation instance

  1. On the Prometheus Monitoring page, click the name of the Prometheus instance. In the left-side navigation pane, click Alert Rules.
  2. In the upper-right corner of the page, click Create Prometheus Alert Rule. On the Create Prometheus Alert Rule page, configure parameters for the alert rule. For more information, see Create an alert rule for a Prometheus instance.
    Note In the Data Preview section of the Create Prometheus Alert Rule page, the unique_cluster_id and unique_cluster_name fields of the global aggregation instance are displayed. The fields help you identify the instances that trigger alerts.

Delete the global aggregation instance

If you do not need to monitor the global aggregation instance, you can uninstall the Prometheus agent.

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.