Trace Explorer provides three ways to query traces: through the search bar, the filter panel, or quick filters. These methods are synchronized, so you can use them interchangeably.
Search bar
Enter filter conditions directly in the search bar on the Trace Explorer page.
Trace Explorer is compatible with the query syntax of Simple Log Service (SLS).
-
For more information about query fields, see Trace Explorer parameters.
-
For more information about SLS query operators (analytical statements are not supported), see Query operators.
-
To use the "*" and "?" wildcard characters in your filter conditions, select the Allow Fuzzy Search checkbox.
-
Duration is measured in nanoseconds. For example, to filter traces with a duration greater than 500 ms, enter the expression
duration >= 500000000. To query traces with a duration within a specific range, such as 0 to 500 ms, enterduration in (0 500000000). This specifies a left-closed, right-open interval by default. -
To query fields in attributes or resources, add the
attributes.orresources.prefix to your query.
Query syntax examples:
-
To find traces with the span name
/components/api/v1/ads/dataand an HTTP status code of 500:spanName : "/components/api/v1/ads/data" and attributes.http.status_code : 500 -
To find traces with exceptions from the
opentelemetry-demo-adserviceapplication:serviceName : "opentelemetry-demo-adservice" and attributes.excep.ids : *
Filter panel
Click the search bar on the Trace Explorer page to open the filter panel. In this panel, you can set filter conditions and add new ones for custom attributes and resources.
Commonly used fields in the filter panel include serviceName (application name), spanName (span name), ip (host address), traceId (trace ID), and duration. The supported operators are :, =, !=, oneOf, and not oneOf. The panel also provides pre-defined filters, such as Traces with Code Hotspots Only, Root Spans Only, Slow Call Spans Only, and Exception Spans Only. The advanced query section includes the kind (span kind) and statusCode (status) fields.
-
To select multiple values, change the operator to oneOf and select the desired values. To exclude a set of values, change the operator to not oneOf.
-
Duration is measured in nanoseconds. For example, to filter traces with a duration greater than 500 ms, enter the expression
duration >= 500000000. To query traces with a duration within a specific range, such as 0 to 500 ms, enterduration in (0 500000000). This specifies a left-closed, right-open interval by default. -
To add a filter condition for an attribute or resource, click + Add Query Condition.
Quick filter
In the quick filter section on the left of the Trace Explorer page, you can quickly filter traces by status, duration, application name, span name, and host address.
-
For example, if you select Error in the Status section, you can quickly filter for exception traces where
statusCode=2. -
Selecting an application or span quickly filters for its associated traces.
The quick filter feature allows for convenient, multi-level filtering. It provides a real-time view of the data distribution based on your current filter combination, helping you identify potential anomalies.