SAE alert field extension
Alert notifications for Serverless App Engine (SAE) are integrated with the Operation Center of Application Real-Time Monitoring Service (ARMS). The Operation Center lets you extend alert fields. This topic describes how to add namespace information to SAE alert notifications.
Step 1: Prepare the data source
In an Excel file, map SAE namespaces to their corresponding application IDs. You can define the field names, such as AppId and NameSpace. In the following example, the data source contains two applications whose AppId values are b47996e8-1a3f-47d8-a798-xxx and c934e9fc-79ae-4422-af05-xxx. Both applications have the same NameSpace value: cn-beijing:eshopdemo.
For the initial setup, you need a file with all application-to-namespace mappings. SAE does not provide a feature to export this data. To obtain the data, join the DingTalk group (ID: 32874633) and contact SAE technical support for assistance. After the initial setup, you must maintain this data source when adding new applications.
Step 2: Import the data source
-
Log on to the Operation Center console.
-
In the left-side navigation pane, click Data Source. On the Data Source page, click Create Data Source in the upper-right corner.
-
On the Create Data Source page, enter the required information and click Next.
Parameter
Description
Data source name
Enter a custom name.
Data source type
Select LOCAL from the drop-down list.
-
In the file upload area, upload the Excel file that you prepared in Step 1.
After creating the data source, you are redirected to the Data Source page. The imported data source appears in the list, displaying its name, type, creation time, and update time. The list also provides options to Edit, Update, or Delete the data source.
Step 3: Create an event processing flow
-
In the left-side navigation pane, click Event Processing Flows. On the Event Processing Flows page, click New Processing Flow in the upper-right corner.
-
On the New Processing Flow page, configure the following parameters.
-
In the Basic information section, enter a custom Processing flow name.
-
In the Flow action settings section, under Available actions, drag the Enrich Fields action to the Event Processing Flows canvas and drop it below the Trigger Conditions node.
-
Click the Trigger Conditions node. In the Trigger Conditions configuration pane that appears on the right, configure the conditions.
This workflow triggers for any alert notification that meets the following conditions.
Parameter
Description
First text box
Enter _aliyun_arms_involvedObject_id.
Drop-down list
Select Regular Expression.
Second text box
Enter .\*.
-
Click the Enrich Fields node and configure its parameters.
Parameter
Description
Select data source
From the drop-down list, select the data source that you imported in Step 2.
Match update mode
AppId (the field name for the application ID in your data source) equals _aliyun_arms_involvedObject_id.
Fields to fill
Fill the value from NameSpace (the field name for the namespace in your data source) into the ns field. You can customize this destination field name. This example uses ns, which is referenced in the template in Step 4.
-
-
After you complete the configuration, click Save.
After creating the processing flow, you are redirected to the Event Processing Flows page. The flow appears in the list with an Active status. In the Operations column, you can manage the flow by using options such as Move Up, Move Down, Stop, Edit, and Delete.
Step 4: Configure the alert notification template
-
Go to the SAE application list. Select the target region and namespace at the top of the page. Then, click the Application ID of your target application to open its details page.
-
In the left-side navigation pane, choose . On the Notification Policies page, find the target policy in the Notification Policy List section and click it. In the editing pane that appears on the right, click the
icon. -
On the edit page, in the When an alert is triggered section, click Notification Template. In the Notification Template dialog box, add the namespace information, for example, Namespace: {{ .commonLabels.ns }}. Then, click OK.
Add the same namespace information to the notification content in both the Notification Template and Recovery template sections.
NoteThe property name after
commonLabelsmust match the destination field name you configured for the Enrich Fields node in Step 3. -
After you complete the configuration, click Save.
After you configure the template, subsequent alert notifications will include the namespace information. You can follow these same steps to add other custom fields to your notifications.