Menu
Grafana Cloud

Query tracing data

You can compose TraceQL queries in Grafana and Grafana Cloud using Explore and a Tempo data source. You can use either the Query type > Search (the TraceQL query builder) or the TraceQL tab (the TraceQL query editor). Both of these methods let you build queries and drill-down into result sets.

Note

Queries return a maximum of 1,000 results.

To learn more about how to query by TraceQL, refer to the TraceQL documentation.

Query using Search or TraceQL UI

You can use the TraceQL query builder or the query editor to explore your tracing data.

TraceQL query builder

The TraceQL query builder, located on the Explore > Query type > Search in Grafana, provides drop-downs and text fields to help you write a query.

Refer to the Search using the TraceQL query builder documentation to learn more about creating queries using convenient drop-down menus.

The TraceQL query builder

TraceQL query editor

The TraceQL query editor, located on the Explore > TraceQL tab in Grafana, lets you search by trace ID and write TraceQL queries using autocomplete.

Refer to the TraceQL query editor documentation to learn more about constructing queries using a code editor-like experience.

The TraceQL query editor

Cross-tenant TraceQL queries

If you have configured multi-stack Tempo data source, you can perform TraceQL queries across those stacks and tenants. Refer to Set up a multi-stack Tempo data source in Grafana for information about configuring the Tempo data source.

Queries performed using the cross-tenant configured data source, in either Explore or inside of dashboards, are performed across all the tenants that you specified in the X-Scope-OrgID header.

TraceQL queries that compare multiple spansets

may not correctly return all traces in a cross-tenant query. For instance,

{ span.attr1 = "bar" } && { span.attr2 = "foo" }

TraceQL evaluates a contiguously stored trace. If these two conditions are satisfied in separate tenants, then Tempo doesn’t return the trace.