The Prometheus AlertManager plug-in is integrated with the open source and standard interface /api/v2/alerts. You can use the plug-in to visualize ARMS alert events that have not been cleared or are being blocked in Grafana. This topic describes how to use the Prometheus AlertManager plug-in to connect a data source to Grafana.
Interface
For information about the /api/v2/alerts interface, see /api/v2/alerts.
Limits
The Grafana version must be 9.0.X or later.
Procedure
Log on to the ARMS console. In the left-side navigation pane, choose .
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.
NoteYou can log on to Grafana with the administrator account of Grafana and the password that you configured when you created the workspace. You can also click Sign in with Alibaba Cloud to log on to Grafana with the current Alibaba Cloud account.
In the left-side navigation pane of Grafana, choose . On the Plugins tab, search for and install the plug-in Prometheus AlertManager Datasource.
Log on to the ARMS console. In the left-side navigation pane, choose .
On the Alert Event Analysis page, click Obtain API Information. In the API Information dialog box, copy the JWT token.

In the left-side navigation pane, choose .
On the Data sources tab, click Add data source and select Prometheus AlertManager.
On the Settings tab, configure the data source of the Prometheus AlertManager Datasource plug-in.
NoteIf the 403 error code is reported, ignore it. The error code does not affect the use of the plug-in.

Set the URL to
https://alerts.aliyuncs.com.Click Add header. Set the Header field to
Authorizationand the Value field to Bearer {JWT Token}, for example,Bearer eywokxidngkTkd****.NoteThe JWT token is obtained in Step 5.
After the configurations are complete, click Save & test.
In the left-side navigation pane, choose . On the page that appears, click Add a new panel.
On the Edit Panel page, set Visualization to Table on the right side, set the Data source field to Prometheus AlertManager, and then click Active to use the preceding data source to generate a table. For information about custom query statements, GitHub.