Microservices Engine (MSE) traffic protection guards your microservices against traffic spikes through throttling, circuit breaking, degradation, and system overload protection. The built-in MSE dashboard provides real-time traffic distribution analysis but retains data for a limited period.
To query metrics over longer time ranges, build custom dashboards, or set up alerts, export the metric logs to Simple Log Service (SLS). The following sections walk you through the full pipeline: installing the log collection agent, configuring the data source, verifying log delivery, and creating charts from the exported data.
MSE dashboard vs. SLS export
| Approach | Retention | Query flexibility | Custom dashboards | Alerting |
|---|---|---|---|---|
| Built-in MSE dashboard | Limited (short-term) | Pre-built views only | No | No |
| Export to SLS | Configurable (days to years) | Full SQL-like queries | Yes | Yes |
Use the built-in dashboard for real-time monitoring. Export to SLS when you need historical analysis, cross-resource correlation, or automated alerting.
How it works
MSE traffic protection is powered by Sentinel, which writes metric logs to local files on each pod. The Logtail agent collects these log files and ships them to an SLS Logstore. Once in SLS, you can query the data with SQL-like statements and build dashboards.
Pod (Sentinel metric logs) --> Logtail agent --> SLS Logstore --> Query & dashboardsBefore you begin
Activate Simple Log Service. See "Step 1: Activate Simple Log Service" in Getting Started.
Create an ACK cluster. Use either an ACK managed cluster or an ACK dedicated cluster.
Enable MSE traffic protection. Turn on traffic protection for MSE Microservices Governance and configure traffic protection rules. See Overview.
Metric log format
Each line in the Sentinel metric log contains pipe-delimited fields. Understanding this format helps when you configure the log parser and write queries.
Sample log line:
1724811932000|2024-08-28 02:25:32|com.alibabacloud.mse.demo.c.service.HelloServiceCTwo|24|0|24|0|1|0|1|202|OUTField reference:
| Index | Example value | Description |
|---|---|---|
| 1 | 1724811932000 | Timestamp (milliseconds since epoch) |
| 2 | 2024-08-28 02:25:32 | Date and time (human-readable) |
| 3 | com.alibabacloud.mse.demo.c.service.HelloServiceCTwo | Resource name (the protected interface or method) |
| 4 | 24 | Passed requests per second |
| 5 | 0 | Blocked requests per second |
| 6 | 24 | Completed requests per second |
| 7 | 0 | Exceptions per second |
| 8 | 1 | Average response time (ms) |
| 9 | 0 | Reserved field |
| 10 | 1 | Reserved field |
| 11 | 202 | Classification code |
| 12 | OUT | Traffic direction (IN = inbound, OUT = outbound) |
For details about log file paths and formats, see Important logs.
Step 1: Install Logtail
Skip this step if Simple Log Service was already enabled when the ACK cluster was created. See Install Logtail when you create a cluster.
Install the Logtail component in your ACK managed cluster or ACK dedicated cluster:
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find your cluster and click its name. In the left-side navigation pane, choose Operations > Add-ons.
On the Logs and Monitoring tab, find the logtail-ds card and click Install.
Step 2: Configure the SLS data source
Set up SLS to collect, parse, and index the Sentinel metric logs from your pods.
Log on to the Simple Log Service console.
Click the Quick Data Import card. In the Import Data dialog box, search for Kubernetes and click the Kubernetes - File card.
Select Logstore -- Configure the following parameters, then click Next.
Parameter Description Project Select an existing project or create one. Use the naming convention k8s-log-{your ACK cluster ID}.Logstore Select an existing Logstore or create one. For details, see Create a Logstore. Machine Group Configurations -- Select the Kubernetes-group-${your ACK cluster ID} machine group from the Source Machine Group list, add it to the Applied Server Groups list, and click Next.
NoteIf you selected a different project in the previous step, create a machine group as prompted.
Logtail Configuration -- Configure the data source and parsing format, then click Next.
Parameter How to configure Configuration Name Enter a descriptive name, such as mse-sentinel-metrics.File Path Enter the path in the format ${user_home}/logs/csp/{app_name}-metrics.log.{date}. For example, if the home directory is/root, set the directory to/root/logs/cspand the file name to*metrics.log*.Log Sample Paste a sample log line: 1724811932000|2024-08-28 02:25:32|com.alibabacloud.mse.demo.c.service.HelloServiceCTwo|24|0|24|0|1|0|1|202|OUTProcessing Method Select Processors, then add a processor of type Data Parsing (Delimiter Mode). Use the pipe character |as the delimiter.
Query and Analysis Configurations -- Wait for the Preview Data section to refresh automatically. Review and adjust the index fields as needed, then click Next.

For more information about data source configuration, see Configure data source and parsing format.
Step 3: Verify log delivery
Confirm that metric data is flowing into SLS before you build dashboards.
Log on to the Simple Log Service console.
In the Projects section, click your project, then select your Logstore.
Run the following query to check for recent records: If records are returned, the pipeline is working. The results contain the parsed fields from the metric log format described earlier: timestamp, resource name, pass count, block count, average response time, and traffic direction.
* | SELECT * LIMIT 10(Optional) Verify that blocked-request data is present by running:
NoteThe field names in these queries (
resource_name,blocked) depend on how the index fields were named during Step 2. Adjust them to match your configuration.* | SELECT resource_name, blocked WHERE blocked > 0 LIMIT 10
