Hybrid Cloud Monitoring integrates with Grafana through built-in dashboards and a Grafana plug-in. You can also connect a self-managed Grafana instance to visualize metric data.
Prerequisites
Hybrid Cloud Monitoring is enabled. Enable Hybrid Cloud Monitoring.
Background information
Cloud Monitor supports other Grafana integration methods. Overview.
Procedure
- Install the Grafana software. Note The following example demonstrates how to install Grafana on CentOS. For more information about how to install Grafana on other operating systems, see Install Grafana.
- Log on to the server as the root user.
- Run one of the following commands to install Grafana. Note For more information about the software versions of Grafana and the operating systems supported by Grafana, visit the Grafana download page. In the following example, the Grafana installation package is grafana-8.0.6-1.x86_64.rpm, which is the latest version.
- Method 1:
sudo yum install https://dl.grafana.com/oss/release/grafana-8.0.6-1.x86_64.rpm
- Method 2:
wget https://dl.grafana.com/oss/release/grafana-8.0.6-1.x86_64.rpm
sudo yum localinstall grafana-8.0.6-1.x86_64.rpm
- Method 1:
- Run the following command to start the Grafana service: sudo service grafana-server start
- Optional. Install Grafana panel plug-ins.
If you need to view the monitoring data on a Grafana panel, such as Pie Chart, Gantt, or Worldmap Panel, you must install the corresponding panel plug-in. For more information about how to install Grafana panel plug-ins, visit the Grafana panel plug-in page.
-
Create a namespace in Hybrid Cloud Monitoring.
-
Create a metric import task.
Create metric import tasks to import data from on-premises data centers, Alibaba Cloud services, or third-party clouds:
-
Obtain the URL and account credentials.
NoteYou need the URL and credentials from this step to create a data source in Step 6.
-
Log on to the Cloud Monitor console.
-
In the left-side navigation pane, choose .
-
Find the target namespace and choose in the Actions column.
The following table describes the connection parameters.
Parameter
Description
Example
URL
URL for connecting the namespace to Grafana.
Format:
<Endpoint for reporting metric data>/proxy/namespace/<Namespace Name>.For cross-region monitoring, use endpoints in
China (Hangzhou),China (Shanghai),China (Beijing), andChina (Shenzhen)regions:-
Public endpoint
Internet endpoints in
China (Hangzhou),China (Shanghai),China (Beijing), andChina (Shenzhen).-
https://metrichub-cms-cn-shanghai.aliyuncs.com
-
https://metrichub-cms-cn-hangzhou.aliyuncs.com
-
https://metrichub-cms-cn-beijing.aliyuncs.com
-
https://metrichub-cms-cn-shenzhen.aliyuncs.com
-
-
VPC endpoint
VPC endpoints in
China (Hangzhou),China (Shanghai),China (Beijing), andChina (Shenzhen).-
http://metrichub-cn-shanghai.aliyun.com
-
http://metrichub-cn-hangzhou.aliyun.com
-
http://metrichub-cn-beijing.aliyun.com
-
http://metrichub-cn-shenzhen.aliyun.com
-
NoteThese endpoints offer lower latency. Full endpoint list: Appendix 2: Endpoints for reporting metric data.
https://metrichub-cms-cn-hangzhou.aliyuncs.com/proxy/namespace/default-aliyunUser
AccessKey ID of your Alibaba Cloud account or RAM user. Obtain an AccessKey pair.
NoteThe RAM user must belong to your Alibaba Cloud account and have Cloud Monitor read permissions.
yourAccessKeyID
Password
AccessKey Secret of your Alibaba Cloud account or RAM user. Obtain an AccessKey pair.
NoteThe RAM user must belong to your Alibaba Cloud account and have Cloud Monitor read permissions.
yourAccessKeySecret
ImportantThe AccessKey pair of an Alibaba Cloud account can be used to call all API operations. We recommend that you use a RAM user to call API operations or perform routine O&M. Keep your AccessKey pair confidential.
We recommend that you do not include your AccessKey pair in files that are easily accessible to others, such as the project code. Otherwise, your AccessKey pair may be leaked and resources in your account become insecure.
-
-
-
Create a data source.
Grafana defaults to port 3000 with the username admin.
ImportantChange the default password on your first login.
-
Log in to Grafana.
Login URL format:
http://<Grafana server IP address>:3000. Example: http://192.168.XX.XX:3000. -
In the left-side navigation pane, click
. -
On the Data Sources tab, click Add data source in the upper-right corner.
-
On the Add data source page, click Prometheus.
-
On the Settings tab, configure Name, URL, User, and Password. Keep defaults for other parameters.
-
Name: Data source name. Example:
Prometheus-test. -
URL: Namespace connection URL from Step 5. Example:
https://metrichub-cms-cn-hangzhou.aliyuncs.com/proxy/namespace/default-aliyun. -
User and Password: Use the User and Password from Step 5, for example,
yourAccessKeyIDandyourAccessKeySecret.NoteThese fields appear in Basic Auth Details after you enable Basic auth in the Auth section.
-
-
Click Save & Test.
-
-
Add a dashboard and chart.
-
In the left-side navigation pane, click the
icon. -
On the New dashboard page, click Add an empty panel.
-
On the Query tab, select Prometheus-test from the Data source drop-down list, and then select the target cloud service metrics.
-
In the right-side pane, configure the chart name, type, and style.
-
In the upper-right corner, click Apply.
-
In the upper-right corner, click the
icon, and then set a name and folder for the dashboard. -
Click Save.
-
- View monitoring data.
- In the left-side navigation pane, choose .
- On the Manage tab, click the dashboard. View all monitoring charts on the dashboard.
> Manage