All Products
Search
Document Center

Application Real-Time Monitoring Service:Associate trace IDs with logs for a Go application

Last Updated:Jul 28, 2025

Application Real-Time Monitoring Service (ARMS) allows you to associate trace IDs with the logs of a Go application. This way, if an error occurs in the application, you can access the logs associated with the trace IDs to locate and troubleshoot the error.

Prerequisites

  • The application is compiled and deployed using the ARMS agent for Go.

  • Logs are collected by using Simple Log Service. For more information, see Data collection overview.

Background information

The capability of associating trace IDs with logs of Go microservices in ARMS relies on the instrumentation of log frameworks. The following table lists the supported log frameworks.

Component

Repository address

Minimum version

Maximum version

Zerolog

https://github.com/rs/zerolog

V1.10.0

V1.33.0

Zap

https://github.com/uber-go/zap

V1.20.0

V1.27.0

Logrus

https://github.com/sirupsen/logrus

V1.5.0

V1.9.3

Log

https://pkg.go.dev/log

V1.21

N/A

Slog

https://pkg.go.dev/log/slog

V1.21

N/A

Procedure

  1. Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.

  2. Select a region in the top navigation bar and click the application.

    Note

    Icons in the Language column indicate the application's programming language:

    • Java图标: Java

    • image: Go

    • image: Python

    • - (Hyphen): an application monitored in Managed Service for OpenTelemetry

  3. In the top navigation bar, choose Configuration > Custom Configurations.

  4. In the Application log Association configuration section of the Custom Configurations tab, set Log Source to Log service SLS. Turn on Automatically associate business logs with TraceId, select the region where your Simple Log Service is deployed, and bind a project and a Logstore.

    image.png

  5. Check whether trace IDs are displayed in the application logs, as shown in the following figure. If so, the logs are associated with the trace IDs.2024-12-17_10-00-08

  6. (Optional) Configure log collection and upload application logs to the project and Logstore.

    By default, the ARMS agent for Go does not collect application logs.

    2024-12-17_10-43-30