All Products
Search
Document Center

Managed Service for Grafana:Configure a unified dashboard for multi-account services

Last Updated:Jun 10, 2026

Consolidate cloud service data from multiple Alibaba Cloud accounts into a single Managed Service for Grafana workspace for unified cross-account monitoring. ECS data is used as an example.

Background

If you manage multiple Alibaba Cloud accounts with cloud services such as ECS, you can consolidate their data into a single Grafana workspace for cross-account monitoring.

Example scenario

The examples below show how to integrate ECS data from Alibaba Cloud accounts A and B into Account A's Grafana workspace, using Grafana v9.0.x and v10.x.

Step 1: Integrate Account A's ECS data

Log on to Alibaba Cloud Account A and integrate its ECS data into Managed Service for Grafana.

  1. Log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. On the Workspace Management page, click the ID of the workspace that you want to manage.

  3. On the Workspace Information page, click Prometheus Cloud Monitoring Service (Old) in the Cloud Service Integration section.

  4. Select the data source to integrate, click Integration in the Actions column, and then click Confirm.

    Note

    Click Configure Cloud Service Monitoring to connect more cloud services to Managed Service for Prometheus.

    An integrated data source shows a status of Integrated in the Status column.

  5. Click the folder icon next to the data source to open its dashboard folder on the Grafana Dashboards page.

  6. Click the folder to view its dashboards.

Step 2: Add the ECS component

Connect the ECS data from Alibaba Cloud account B to the Managed Service for Prometheus cloud service, and use the Managed Service for Prometheus cloud service to add the ECS data source to the Grafana workspace created by Alibaba Cloud account A.

  1. Switch to Alibaba Cloud Account B and log on to the ARMS console.

  2. On the Overview page, click Add Other Components in the Access Center section, or click Access Center in the left-side navigation pane.

  3. On the Access Center page, click Alibaba Cloud ECS in the Infrastructures section.

  4. In the panel that appears, select a storage region and click OK.

  5. After the integration is successful, click Data Import Management.

    Note

    If the ECS instances in the account are already connected to Managed Service for Prometheus, you can go to the Prometheus Monitoring > Instances page on the ARMS console. Click the name of an instance whose Instance Type is Prometheus Instance for Cloud Services to view the connected ECS instances.

Step 3: Obtain the HTTP API endpoint

  1. In the left navigation pane, click Integration Management.

  2. On the Integration Management page, on the Integrated Environments tab, select Cloud Service Region.

  3. In the Cloud Service Region list, click the name of the target environment.

  4. On the Component Management tab, click the name of Default Metric Storage.

  5. On the Modify tab, copy and save the public endpoint from the HTTP API Endpoint (for Grafana Read) field.

    Note

    Use the public endpoint. The internal endpoint does not support cross-account connections.

Step 4: Configure the Grafana data source

Grafana v9.x

  1. Switch to Alibaba Cloud Account A and log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. On the Workspace Management page, find the workspace that you want to manage and click the URL in the URL column to go to Grafana.

    Note

    Log on to Grafana with your Admin credentials or by clicking Sign in with Alibaba Cloud.

  3. In the left-side navigation pane of Grafana, choose Settings > Data sources.

  4. On the Data Sources tab, click Add data source.

  5. On the Add data source page, click Prometheus.

  6. On the Settings page, enter a Name for the data source. In the HTTP section, paste the public endpoint from Step 3 into the URL field.

  7. Click Save & test.

    A Data source is working message confirms the data source was added successfully. For additional options, refer to the official Grafana documentation.

Grafana v10.x

  1. Switch to Alibaba Cloud Account A and log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. On the Workspace Management page, find the workspace that you want to manage and click the URL in the URL column to go to Grafana.

    Note

    Log on to Grafana with your Admin credentials or by clicking Sign in with Alibaba Cloud.

  3. In the left-side navigation pane, click Manage, and then click Data Source.

  4. On the data sources page, click + Add data source.

  5. On the Add data source page, click Prometheus.

  6. On the Settings page, enter a Name for the data source. In the HTTP section, paste the public endpoint from Step 3 into the URL field.

  7. Click Save & test.

    A Data source is working message confirms the data source was added successfully. For additional options, refer to the official Grafana documentation.

Step 5: Create a dashboard for Account B

Import and modify Account A's dashboard to create one for Account B's ECS data.

Grafana v9.x

  1. In the left-side navigation pane, click the image icon, and then click Browse.

  2. Click the name of the dashboard that you created in Step 4.

  3. At the top of the page, click the image icon, and then click Export.

  4. On the Export tab, enable Export for sharing externally, and then click Save to file to export the dashboard as a JSON file.

  5. In the left-side navigation pane, click the 34 icon, and then click Import.

  6. On the Import page, click Upload JSON file, and then open the JSON file exported in Step 4.

  7. In the Options section, modify the dashboard information as described in the following table.

    Parameter

    Description

    Name

    Custom name for the dashboard.

    Folder

    Folder to store the dashboard.

    Unique identifier (UID)

    Click Change uid to assign a unique dashboard UID.

    Select a Prometheus data source drop-down list

    Select the data source integrated in Step 4.

    If the UID conflicts with an existing dashboard, a warning appears. Click Import (Overwrite) to replace the existing dashboard.

  8. Click Import. The dashboard appears after a few seconds.

Grafana v10.x

  1. In the left-side navigation pane, click Dashboard.

  2. On the Dashboard page, click the name of the dashboard that you created in Step 4.

  3. At the top of the page, click the image icon, and then click Export.

  4. On the Export tab, enable Export for sharing externally, and then click Save to file to export the dashboard as a JSON file.

  5. In the left-side navigation pane, click Dashboard.

  6. On the Dashboard page, click the Create drop-down list, and then click Import.

  7. On the Import dashboard page, click the image icon to open the JSON file that you exported in Step 5.

  8. In the Options section, modify the dashboard information as described in the following table.

    Parameter

    Description

    Name

    Custom name for the dashboard.

    Folder

    Folder to store the dashboard.

    Unique identifier (UID)

    Click Change uid to assign a unique dashboard UID.

    If the UID conflicts with an existing dashboard, a warning appears. Click Import (Overwrite) to replace the existing dashboard.

  9. Click Import. The dashboard appears after a few seconds.

Advanced operations

The previous steps use separate dashboards per account. This section shows how to display all data sources in a single unified dashboard.

Grafana v9.x

  1. Use Step 4 to add all accounts' cloud service data to Grafana and create a dashboard for one data source.

    Important

    Use a consistent naming pattern for data sources so you can filter them with regular expressions.

    On the Grafana Configuration > Data sources page, enter keywords in the search box to verify that your naming pattern (for example, suffixes like 001, 002) is easy to filter.

  2. In the left-side navigation pane, click the image icon, and then click the name of the data dashboard you created.

  3. After you open the dashboard, click the image icon in the upper-right corner.

    image

  4. In the left-side navigation pane, click Variables, and then click Add variable.

  5. On the Edit page, configure the following parameters, and then click Update.

    Section

    Parameter

    Description

    General

    Name

    Custom name for the variable.

    Type

    Select Data source.

    Data source options

    Type

    Select Prometheus.

    Instance name filter

    Regular expression to filter data sources, such as /.*-(.*)-.*/.

  6. Update all relevant variables and panels to use the new data source variable.

    1. Modify variables.

      1. On the Variables page, click New.

      2. On the Edit page, in the General section, set Type to Query.

      3. In the Query Options section, set Data source to the variable name you created in the previous step, such as ${query0}.

      4. Click Update.

    2. Modify panels.

      1. On the dashboard page, click the panel title, and then click Edit.

      2. On the Edit Panel page, on the Query tab, select the variable name you created from the data source drop-down list, such as ${query0}.

      3. In the upper-right corner, click Apply.

  7. In the upper-right corner of the dashboard page, click the Settings icon icon, and then click JSON Model in the left-side navigation pane.

  8. On the JSON Model page, replace all datasource values with your variable name.

    For example:
    "datasource": {
      "type": "Prometheus",
      "uid": "${query0}"
    },
  9. Click Save changes.

  10. After saving, use the drop-down menu at the top of the dashboard to switch between data sources.

    image

Grafana v10.x

  1. Use Step 4 to add all accounts' cloud service data to Grafana and create a dashboard for one data source.

    Important

    Use a consistent naming pattern for data sources so you can filter them with regular expressions.

  2. In the left-side navigation pane, click Dashboard, and then click the data dashboard you created.

  3. After you open the dashboard, click the image icon in the upper-right corner.

    image

  4. In the left-side navigation pane, click Variables, and then click Add variable.

  5. Configure the following parameters, and then click Apply.

    Parameter

    Description

    Select variable type

    Select Data source.

    Name

    Custom name for the variable.

    Show on dashboard

    Select Label and value.

    Type

    Select Prometheus.

    Instance name filter

    Regular expression to filter data sources, such as /.*-(.*)-.*/.

  6. Update all relevant variables and panels to use the new data source variable.

    1. Modify variables.

      1. On the Variables page, click + New variable.

      2. Configure the following parameters, and then click Apply.

        Parameter

        Description

        Select variable type

        Select Query.

        Name

        Custom name for the variable.

        Show on dashboard

        Select Label and value.

        Data source

        Select the variable you created, such as ${query01}.

        Query

        Select your desired Query Type, Label, and Metric.

        Sort

        Select Disabled.

        Refresh

        Select On dashboard load.

    2. Modify panels.

      1. On the dashboard page, click the image icon on the target panel, and then click Edit.

      2. On the Edit Panel page, on the Query tab, select the variable name you created from the data source drop-down list, such as ${query0}.

      3. In the upper-right corner, click Apply.

  7. In the upper-right corner of the dashboard page, click the Settings icon icon, and then click JSON Model in the left-side navigation pane.

  8. On the JSON Model page, replace all datasource values with your variable name.

    For example:
    "datasource": {
      "type": "Prometheus",
      "uid": "${query01}"
    },
  9. Click Save changes.

  10. After saving, use the drop-down menu at the top of the dashboard to switch between data sources.

    image