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.
Step 1: Obtain the dedicated API provided by Prometheus Monitoring
The dedicated API connects Prometheus Monitoring to the local Grafana system. Perform the following steps to obtain the API:
- Log on to the ARMS console.
- In the left-side navigation pane, click Prometheus Monitoring.
- In the upper-left corner of the Prometheus Monitoring page, select the region where the Container Service for Kubernetes cluster resides. Find the cluster and click Settings in the Actions column.
- On the Settings page, click the Agent Settings tab.
- On the Agent Settings tab, copy the URL next to Step 2: API URL.
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:
- Log on to the local Grafana system as the administrator.
- In the left-side navigation pane, choose .Note This menu is visible only to the administrator.
- On the Data Sources tab, click Add Data Source.
- On the Add Data Source page, click Prometheus.
- On the Settings tab, enter a name in the Name field, enter the API URL obtained in Step 1 in the URL field, and then click Save & Test.
Check the result
Perform the following steps to check whether the data source is added:
- Log on to the local Grafana system.
- In the left-side navigation pane, click Explore.
- Select the data source added in Step 2 at the top of the Explore page, enter a metric name in the Metrics field, and then press the Enter key.If a chart of the metric is displayed, the data source is added. Otherwise, check whether the URL that you entered is correct and whether the data source contains the data from Prometheus Monitoring.