All Products
Search
Document Center

Microservices Engine:Use ActionTrail to implement Nacos configuration change notifications

Last Updated:Mar 11, 2026

When multiple teams modify Nacos configurations in Microservices Engine (MSE), tracking who changed what -- and alerting stakeholders in real time -- becomes difficult without a centralized audit mechanism. ActionTrail captures every Nacos configuration change as an auditable event and delivers it to Simple Log Service (SLS), where an alert rule forwards formatted notifications to a webhook endpoint such as DingTalk.

This audit-trail approach is suited for scenarios where you need:

  • Compliance and audit trails -- a tamper-proof record of who changed what and when

  • Cross-service visibility -- a single notification pipeline that covers Nacos and other Alibaba Cloud services

  • Separation of concerns -- configuration change monitoring independent of application code

Note

If you only need in-application callbacks for configuration changes (lower latency, simpler setup), use the native Nacos SDK listener (@NacosConfigListener) instead. The ActionTrail approach described here is designed for organization-wide auditing and compliance.

How it works

The notification pipeline connects four services:

MSE Nacos --> ActionTrail --> SLS alert rule --> DingTalk webhook
  1. A user or API call modifies a Nacos configuration in MSE.

  2. ActionTrail captures the change as an UpdateNacosConfig event.

  3. An SLS alert rule queries ActionTrail events at a fixed interval.

  4. When the rule matches, SLS sends a formatted notification to a DingTalk webhook.

Prerequisites

Before you begin, make sure that you have:

Step 1: Create a Nacos configuration

Create a sample configuration to use throughout this tutorial.

  1. Go to the Instances page of the MSE console and click your target Nacos instance.

  2. Click Configurations, then click Add Configuration.

  3. In the Add Configuration pane, set the following parameters and keep the defaults for everything else:

    ParameterValue
    Data IDaction-test
    Groupaction
    Configuration Contentaliyun
  4. Click Release.

    Add Configuration pane

Step 2: Create a trail to capture Nacos events

A trail defines which events ActionTrail captures and delivers to SLS for querying and alerting.

  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 both Management Event and Data Event.

    Trail basic information

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

  4. In the Data Event Selector section, leave the filters blank to deliver all MSE events by default, then click Confirm.

Step 3: Verify that ActionTrail captures configuration changes

Before setting up notifications, confirm that ActionTrail records Nacos configuration changes correctly.

  1. Go to the Instances page of the MSE console and click your target Nacos instance.

  2. Click Configurations, then click Edit next to the configuration you created in Step 1.

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

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

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

    Advanced event query results

  6. Click View Details to inspect the full event record for the configuration change.

Step 4: Configure a DingTalk webhook notification

This step connects a webhook endpoint, a message template, and an alert rule into an end-to-end notification pipeline.

4.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 the following parameters:

    ParameterValue
    IDmse-test-dingding
    NameDingTalk Robot
    TypeDingTalk
    Request URLhttps://oapi.dingtalk.com/robot/send?access_token=xxxx
  3. Click OK.

Note

Replace the Request URL with the actual webhook address from your DingTalk custom robot. For setup instructions, see Custom Robot Access.

4.2 Create a content template

  1. Click Notification Management > Alert Template > Create.

  2. In the Add Alert Template dialog box, set ID to Nacos and Name to Nacos Change.

  3. Select DingTalk. Set Title to Nacos configuration change alert and enter the following content:

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

    Alert template configuration

4.3 Create an alert rule

  1. Click Alert Rules > Create Alert. Set Rule Name to Nacos and 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 enter the following 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
  4. Add an Annotation with name mse and value ${event.requestparameter}.

    Alert rule annotation

  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 and content template you created earlier, then click OK.

    Alert rule channel configuration

4.4 Test the notification pipeline

  1. Go to the Instances page of the MSE console and click your target Nacos instance.

  2. Click Configurations, then click Edit next to the configuration you created.

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

  4. Open your DingTalk group. Within a few minutes, the webhook delivers a notification with the change details. To include additional fields in the notification, update the content template in Step 4.2 with other event attributes.