The log analysis feature of Managed Service for OpenTelemetry depends on Log Service. The Managed Service for OpenTelemetry console is embedded with the Log Service console page where you can analyze logs. If an error occurs when your application is running, you can query and analyze logs in the Managed Service for OpenTelemetry console to troubleshoot the error.
Prerequisites
- The application is connected to Managed Service for OpenTelemetry. For more information, see Preparations.
- Log Service is activated. If Log Service is not activated, log on to the Log Service console and activate Log Service as prompted.
- A Log Service project is created. For more information, see Create a project.
- A Log Service Logstore is created. For more information, see Create a Logstore.
- Application logs are collected and reported to Log Service. For more information, see Data collection overview.
Step 1: Associate logs with trace IDs
- Log on to the Managed Service for OpenTelemetry console. In the left-side navigation pane, click Applications.
- On the Applications page, select a region in the top navigation bar and click the name of the application that you want to manage.
- In the left-side navigation pane, click Application Settings.
- In the Business log Association settings section of the Custom Configuration tab, specify a project and Logstore and configure the Associated index parameter. NoteThe Associated index parameter is used in the queries of logs based on trace IDs.
- If full-text indexing is enabled in Log Service, set the Associated index parameter to Full-text index.
- If
trace ID
-based field indexing is enabled in Log Service, set the Associated index parameter to the configured index.For information about how to display trace IDs in logs, see the related descriptions in the topics for different tracing systems.
- In the lower-left corner of the Custom Configuration tab, click Save.
Step 2: Query and analyze logs
- In the left-side navigation pane, click Log Analysis.
- On the Log Analysis page, perform the following operations: