You can use the dedicated API provided by Prometheus Monitoring to view the monitoring data in a local Grafana system. This topic describes how to import data from Prometheus Monitoring to a local Grafana system.

Prerequisites

Step 1: Obtain the dedicated API provided by Prometheus Monitoring

The dedicated API connects Prometheus Monitoring to the local Grafana system. To obtain the API, perform the following steps:

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Prometheus Monitoring > Prometheus Instances.
  3. In the upper-left corner of the Prometheus Monitoring page, select the region where the Prometheus instance resides. Find the Prometheus instance and click Settings in the Actions column.
  4. On the page that appears, click the Agent Settings tab.
  5. On the Agent Settings tab, copy an HTTP API URL for access from the Internet or from an internal network as needed.
    Note If the Prometheus instance is created to monitor a cloud service, select an HTTP API URL based on the type of the cloud service.
    pg_pm_settings_tab_agent_settings
  6. Optional:Click Generate Token in the upper part of the tab to obtain the authentication token of the Prometheus instance. This way, you can transfer data from the Prometheus instance to your Grafana system in a more secure way.
    Notice After the authentication token is generated, you must specify the token when you add the Prometheus instance to your Grafana system as a data source. Otherwise, monitoring data cannot be read from the Prometheus instance.
    Copy a token

Step 2: Add a data source to the local Grafana system

To add the API obtained in Step 1 as the data source of the local Grafana system, perform the following steps:

  1. Log on to the local Grafana system as the administrator.
  2. In the left-side navigation pane, choose Configuration > Data Sources.
    Note This menu is visible only to the administrator.
  3. On the Data Sources tab, click Add Data Source.
  4. On the Add Data Source page, click Prometheus.
  5. On the Settings tab, enter a name in the Name field and copy the Step 1: Obtain the dedicated API provided by Prometheus Monitoring HTTP API URL to the URL field.
  6. Optional:In the Custom HTTP Headers section, click Add Header and set the Header parameter to Authorization and the Value parameter to the authentication token that you obtained in the Step 1: Obtain the dedicated API provided by Prometheus Monitoring section of this topic.
    tab_settings
  7. Click Save & Test in the lower part of the tab.

Check the result

Perform the following steps to check whether the data source is added:

  1. Log on to the local Grafana system.
  2. In the left-side navigation pane, choose + > Create.
  3. On the New Dashboard page, click Add Empty Panel.
  4. On the Query tab of the New dashboard/Edit Panel page, select the data source added in Step 2 from the drop-down list. In the Metrics field of the A section, enter a metric name and press Enter.
    If a chart of the metric is displayed, the data source is added. Otherwise, check whether the URL or the authentication token that you entered is correct and whether the data source contains the data from Prometheus Monitoring. pg_explore_with_metrics