Alibaba Cloud Prometheus Service provides remote read endpoints and remote write endpoints.
You can use the endpoints to remotely store monitoring data. This topic describes
how to use the remote read and remote write endpoints to write monitoring data from
open source Prometheus to Alibaba Cloud Prometheus Service.
Prerequisites
A Prometheus instance is created. For more information, see the following topics:
Step 1: (Optional) Grant the read and write permissions on Application Real-Time Monitoring
Service (ARMS) to a RAM user
You created the Alibaba Cloud Prometheus instance by using your Alibaba Cloud account
and you want to use the AccessKey ID and AccessKey secret of a RAM user within your
Alibaba Cloud account to perform remote read and write operations. In this case, you
must grant read and write permissions on ARMS to the RAM user.
- Use your Alibaba Cloud account to log on to the RAM console.
- In the left-side navigation pane, choose .
- On the Grants page, click Grant Permission.
- On the Grant Permission page, set the Principal parameter to the username of the RAM user to whom you want to grant read and write
permissions.
- On the System Policy tab in the Select Policy section, enter a policy name in the search box to search for a policy. In the search
result, click the policy name to add the policy to the Selected section on the right. Then, click OK.
The following policies must be added:
- AliyunARMSFullAccess
- AliyunARMSReadOnlyAccess

Step 2: Obtain the remote read and remote write endpoints
- Log on to the ARMS console .
- In the left-side navigation pane, choose .
- On the Prometheus Monitoring page, select the region where the Prometheus instance that you want to manage is
created and click Settings in the Actions column of the instance.
- On the page that appears, click the Settings tab.
- On the Settings tab, copy the public or private remote read and remote write endpoints based on your
business requirements.
Step 3: Configure open source Prometheus
- Install open source Prometheus. For more information, see Prometheus documentation.
- Open the Prometheus.yaml configuration file and append the following content to the file. Replace the
remote_write
and remote_read
URLs with the endpoints that you obtained in Step 2. Then, save the file. global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
remote_write:
// Set the url parameter to the remote write endpoint that you obtained.
- url: "http://ts-xxxxxxxxxxxx.hitsdb.rds.aliyuncs.com:3242/api/prom_write"
basic_auth:
// Set the username and password parameters to the AccessKey ID and AccessKey secret of your Alibaba Cloud account.
username: access-key-id
password: access-key-secret
remote_read:
// Set the url parameter to the remote read endpoint that you obtained.
- url: "http://ts-xxxxxxxxxxxx.hitsdb.rds.aliyuncs.com:3242/api/prom_read"
read_recent: true
Note
- Alibaba Cloud Prometheus Service provides public and private remote read and remote
write endpoints. For both endpoint types, you must set the username and password parameters.
- Set the username and password parameters to the AccessKey ID and AccessKey secret
of your Alibaba Cloud account. For more information about how to obtain an AccessKey
pair, see Obtain an AccessKey pair.
- You created the Alibaba Cloud Prometheus instance by using your Alibaba Cloud account
and you want to use the AccessKey ID and AccessKey secret of a RAM user within your
Alibaba Cloud account to perform remote read and write operations. In this case, you
must grant read and write permissions on ARMS to the RAM user. For more information,
see Step 1.
View the monitoring data of open source Prometheus
After you run open source Prometheus, you can view the monitoring data of open source
Prometheus on a Grafana dashboard.
- Log on to the ARMS console .
- In the left-side navigation pane, choose .
- On the Dashboards page, click the name of dashboard that you want to view.