All Products
Search
Document Center

Managed Service for OpenTelemetry:Custom query

Last Updated:Jun 20, 2026

Extracting valuable information from massive amounts of log data can be challenging. The custom query feature helps you efficiently navigate complex logs to find key information and resolve issues.

Prerequisites

Before you begin, make sure that you have:

  • An application that reports data to Managed Service for OpenTelemetry. For details, see Integration guide

Procedure

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

  2. In the left-side navigation pane, choose Advanced Query > Custom Query. In the top menu bar, select the target region. The console displays only the Projects and LogStores in the selected region.

  3. In the search box, enter a query analysis statement. A query analysis statement combines a query statement and an analytic statement in the format query statement|analytic statement. For more information about the syntax, see Query syntax and functions and Aggregate functions.

  4. In the upper-right corner, set the time range for the query analysis. You can set a relative time, a time frame, or a custom time range.

  5. In the Index Attributes section, customize specific field queries and indexes.

  6. Click the bell icon to create an alert from your query. For more information, see Create alert rules.

The Custom Query page contains three tabs: Raw Log, Statistical Chart, and Log Clustering. The left pane displays the index fields, such as attributes, duration, and serviceName. The right pane displays the log records returned by the query. You can expand each record to view detailed key-value pairs in the attributes, such as http.status_code, http.method, and component.name.

What to do next

Set up alert rules so that the system automatically notifies your O&M team when metrics cross a threshold. For example, create a rule that triggers when the error rate for a specific operation exceeds a baseline. See Create an alert rule.