All Products
Search
Document Center

Microservices Engine:Use ActionTrail to implement Nacos configuration change notifications

Last Updated:Dec 04, 2025

This topic describes how to use ActionTrail to audit configuration changes for Nacos in Microservices Engine (MSE). By integrating ActionTrail, you can track and record Nacos configuration change events and automatically send notifications. This process ensures that configuration modifications are transparent and traceable.

Solution overview

This section uses a DingTalk webhook as an example to outline how to deploy Nacos configuration change notifications using ActionTrail. The solution involves the following steps:

  1. Create a Nacos configuration file: Create a Nacos configuration file to manage database connection information. This supports the dynamic configuration requirements of your application.

  2. Create a trail: Create a trail to monitor changes to the database profile for security management.

  3. Verify configuration changes using advanced event query: Use the advanced event query feature to verify and review database profile change events. This ensures the security of the changes.

  4. Configure a webhook for change notifications: Configure a webhook to promptly notify relevant personnel in a DingTalk group when the database profile changes.

Create a Nacos configuration file

  1. Go to the Instances page of the Microservices Engine console and click the target Nacos instance.

  2. Click Configurations, and then click Add Configuration.

  3. In the Add Configuration pane, set Data ID to action-test, Group to action, and Configuration Content to aliyun. Keep the default values for the other parameters, and then click Release.image

Create a trail

  1. Go to the Trails page of the ActionTrail console and click Create Trail.

  2. In the Basic Information area, set Trail Name to nacos-test. For Trail Event Type, select Management Event and Data Event.

    image

  3. In the Data Event Delivery Settings area, enter MSE in the search box, find Microservices Engine, and select it.

  4. In the Data Event Selector section, you can configure rules to deliver events as needed. For this example, do not apply any filters to deliver all events by default. Then, click Confirm.

Verify configuration changes using advanced event query

  1. Go to the Instances page of the Microservices Engine console and click the target Nacos instance.

  2. Click Configurations, and then click Edit to the right of the configuration file you created.

  3. Change the configuration content from aliyun to Alibaba Cloud Native, and then click Release.

  4. Go to the Advanced Event Query page of the ActionTrail console. For Trail, select the nacos-test trail that you created.

  5. Set Service Name to Microservices Engine (MSE) and Event Name to UpdateNacosConfig. Then, click Run.image

  6. Click View Details to view the detailed information about the Nacos configuration change.

Configure a webhook for change notifications

1. Create a webhook

  1. Go to the Event Alerting page of the ActionTrail console. Click Notification Objects > Webhook Integration > Create.

  2. In the Create Webhook panel, set ID to mse-test-dingding and Name to DingTalk Robot, select DingTalk for Type, enter https://oapi.dingtalk.com/robot/send?access_token=xxxx for Request URL, and then click OK.

    Note

    The request URL is the webhook address generated when you add a custom robot in DingTalk. You can use this webhook address to push messages to a DingTalk group. For more information, see Custom Robot Access.

2. Configure a content template

  1. Click Notification Management > Alert Template > Create. In the Add Alert Template dialog box, set ID to Nacos and Name to Nacos Change.

  2. Select DingTalk. For Title, enter `Nacos configuration change alert`. For the content, enter the following information:

    Nacos configuration changed by ID {{ alert.aliuid }}
    Change details:
    {{ alert.results[0].raw_results }}

    image

3. Configure an alert rule

  1. Click Alert Rules > Create Alert. In the Create Alert pane, set Rule Name to Nacos and set Check Frequency to a fixed interval of 1 minute.

  2. In the Query Statistics section, add two rules. For JOIN between the two rules, select Concatenate:

    • Rule 1: Click Add, set Time Range to 1 minute (relative), and then configure the search statement.

      * AND (event.serviceName: "MSE") AND (event.acsRegion: "cn-beijing") AND (event.eventName: "UpdateNacosConfig")
    • Rule 2: Click Add and set Time Range to 15 minutes (relative).

    Note

    You can configure the rules as needed.

  3. For Group Evaluation, select Custom Label. For Tags, select event.eventname. Set Trigger Condition to data matches the expression and enter `event.eventname == UpdateNacosConfig` for the evaluation expression.

  4. Add a new Annotation. Set the name to mse and the value to `${event.requestparameter}`.image

  5. In Advanced Setting, set Destination to Simple Log Service Notification. Click Enable and select Simple Mode.

  6. For Channel, select DingTalk. Select the webhook notification channel and content template that you created, and then click OK.

    image

4. Verify that Nacos configuration change notifications are sent to the webhook robot

  1. Go to the Instances page of the Microservices Engine console and click the target Nacos instance.

  2. Click Configurations, and then click Edit to the right of the configuration file you created.

  3. Change the configuration content from Alibaba Cloud Native to Alibaba Cloud, and then click Release.

  4. Open your DingTalk group. You can view the change information delivered by the webhook. If you need other information, you can configure the corresponding fields.