All Products
Search
Document Center

Managed Service for OpenTelemetry:Associate logs with traces

Last Updated:Mar 11, 2026

Trace data alone may not reveal why a request failed or ran slowly. By associating Simple Log Service (SLS) logs with Managed Service for OpenTelemetry, you can navigate from a trace directly to the application logs generated during that operation, making it faster to identify root causes.

How log association works

Log association links an SLS Logstore to applications monitored by Managed Service for OpenTelemetry. After you configure the association, the Managed Service for OpenTelemetry console embeds the SLS log query interface so you can view correlated logs alongside trace data without switching consoles.

Setup consists of two parts:

  1. Collect application logs into SLS -- Write application logs to an SLS Logstore.

  2. Create a log association in the Managed Service for OpenTelemetry console -- Map each application to the SLS project and Logstore that stores its logs.

After both parts are complete, open any trace in Trace Explorer and jump to the associated logs.

Prerequisites

Before you begin, make sure that you have:

  • Application data reported to Managed Service for OpenTelemetry. For more information, see Connection Description

  • An SLS project. For more information, see the Create a project section of the "Manage a project" topic

  • A Logstore in the SLS project. For more information, see the Create a Logstore section of the "Manage a Logstore" topic

  • Trace data collected and imported to Simple Log Service. For more information, see Data collection overview

Create a log association

  1. Log on to the Managed Service for OpenTelemetry console.

  2. In the left-side navigation pane, choose System Configuration > Log Association. In the top navigation bar, select a region.

  3. On the Log Association page, click Create.

  4. In the Add Log Association dialog box, configure the following parameters:

    ParameterDescription
    ApplicationsSelect one or more applications to associate with the Logstore.
    RegionSelect the region where the SLS project resides.
    Log Service ProjectSelect the SLS project that stores the application logs.
    Log Service LogstoreSelect the Logstore that contains the application logs.
    Associated IndexSpecify the index to associate with the applications.

    Add Log Association dialog box

  5. Click OK.

Note

The new association appears on the Log Association page. To modify or remove an association, click Edit or Delete in the Actions column.

Query logs from a trace

After log association is configured, you can view correlated logs for any trace:

  1. In the left-side navigation pane, click Trace Explorer.

  2. In the trace list, locate the trace you want to investigate and click Logs in the Actions column. The Log Query page opens with the business logs that match the selected trace.

Log Query page showing associated business logs

Related topics