Use Resource Directory to ingest metrics from Alibaba Cloud services across multiple accounts into a Cloud Monitor namespace, visualize them in Hybrid Cloud Monitoring dashboards, and configure Prometheus alert rules.
Prerequisites
-
You are signed in with a management account or a delegated administrator account. Add a delegated administrator account for Cloud Monitor.
-
A namespace is created. Create a namespace.
Background information
The following figure shows the cross-account monitoring workflow.
Step 1: Create a multi-account metric ingestion task
Create a multi-account metric ingestion task to report metrics from member accounts in your Resource Directory to a Cloud Monitor namespace.
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose .
-
(Optional) For the target namespace, click one of the
/
/
icons in the Metric Data column.NoteThis step is required only if two or more namespaces exist in the Namespace list.
-
On the Alibaba Cloud Service Metrics tab, click Add Account.
-
In the Add Account dialog box, select a member account from the Resource Directory Member Account drop-down list and click OK.
-
Click the
icon next to the target account. -
In the Add Product dialog box, select the target cloud service and click OK.
-
For the target cloud service, click Add Metric.
-
On the Add Metric page, select the metrics to add and click OK.
Step 2: View monitoring charts
View monitoring charts for metrics ingested from member accounts.
-
On the Namespace tab, click the target namespace.
-
On the Namespace Details page, select a metric.
Step 3: Create custom monitoring charts
Create a custom Hybrid Cloud Monitoring dashboard and add charts for metrics from member accounts.
In the left-side navigation pane, choose .
On the Dashboards page, click View Dashboard.
In the left-side navigation pane of the dashboard, click the
icon. Then, click Add an empty panel. On the Edit Panel page, configure metrics and monitoring charts.
On the Query tab, select the namespace and select metrics.
On the Panel tab, specify a panel title and enter a description. Then, configure visualization and other settings.
In the upper-right corner of the Edit Panel page, click Apply.
The monitoring chart is created.
In the upper-right corner, click the
icon. Then, specify the name of the dashboard and the directory in which the dashboard resides. Click Save.
The dashboard is created.
In the left-side navigation pane of the dashboard, choose . Then, click the dashboard name to view the dashboard.
Step 4: Configure an alert rule
Configure alert rules for metrics from member accounts. When a metric triggers an alert rule, you receive a notification.
In the left-side navigation pane, choose .
In the upper-left corner of the Namespace page, click Create Alert Rule.
In the Create Alert Rule panel, enter a name in the Rule Name field, select a namespace from the Namespace drop-down list, configure the Alert Expression (PromQL) parameter, and then select an alert contact group from the Alert Contact Group drop-down list.
Click OK.