<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Query tracing data on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/</link><description>Recent content in Query tracing data on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/datasources/tempo/query-editor/index.xml" rel="self" type="application/rss+xml"/><item><title>TraceQL query structure</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-structure/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-structure/</guid><content><![CDATA[&lt;h1 id=&#34;traceql-query-structure&#34;&gt;TraceQL query structure&lt;/h1&gt;


&lt;div data-shared=&#34;traceql-query-structure.md&#34;&gt;
            &lt;!--  TraceQL query structure --&gt;
&lt;p&gt;The purpose of TraceQL is to search or query for spans.
The query returns a set of spans, also called a spanset.&lt;/p&gt;
&lt;p&gt;A TraceQL query can select traces based on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;span attributes, timing, and duration&lt;/li&gt;
&lt;li&gt;structural relationships between spans&lt;/li&gt;
&lt;li&gt;aggregated data from the spans in a trace&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/tempo/latest/introduction/trace-structure/&#34;&gt;Trace Structure&lt;/a&gt; for information about trace structure, intrinsics, and span resources and attributes.&lt;/p&gt;
&lt;p&gt;A query is structured as a pipeline of operations (filters and aggregators).
The query expression is evaluated on one trace at a time, selecting or discarding spans from the result.
At each stage of the query pipeline, the selected spans for a trace are grouped in a spanset (set of spans).
The associated trace is also returned. The result of the query is the spansets (and their associated traces) for all the traces evaluated.&lt;/p&gt;
&lt;p&gt;The simplest query is this one:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{ }&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The curly braces encompass the select/filter conditions.
In theory, each span (and the trace it belongs to) matching those conditions is returned by the query.
In the previous example, since there are no filter conditions, all spans are matching and thus returned with their associated traces.&lt;/p&gt;
&lt;p&gt;In practice, the query is performed against a defined time interval, relative (for example, the last 3 hours) or absolute (for example, from X date-time to Y date-time).
The query response is also limited by the number of traces (&lt;strong&gt;Limit&lt;/strong&gt;) and spans per spanset (&lt;strong&gt;Span Limit&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/tempo/traceql/TraceQL-in-Grafana.png&#34;
  alt=&#34;TraceQL in Grafana&#34; width=&#34;3006&#34;
     height=&#34;1544&#34;/&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;TraceQL query editor&lt;/li&gt;
&lt;li&gt;Query options: &lt;strong&gt;Limit&lt;/strong&gt;, &lt;strong&gt;Span Limit&lt;/strong&gt; and &lt;strong&gt;Table Format&lt;/strong&gt; (Traces or Spans).&lt;/li&gt;
&lt;li&gt;Trace (by Trace ID). The &lt;strong&gt;Name&lt;/strong&gt; and &lt;strong&gt;Service&lt;/strong&gt; columns are displaying the trace root span name and associated service. &lt;em&gt;Note:&lt;/em&gt; Trace results for matching spans are returned on a first-match basis. These results may not be the latest traces stored by Tempo.&lt;/li&gt;
&lt;li&gt;Spans associated to the Trace&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="traceql-query-structure">TraceQL query structure&lt;/h1>
&lt;div data-shared="traceql-query-structure.md">
&lt;!-- TraceQL query structure -->
&lt;p>The purpose of TraceQL is to search or query for spans.
The query returns a set of spans, also called a spanset.&lt;/p></description></item><item><title>Investigate traces using Search query builder</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-search/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-search/</guid><content><![CDATA[&lt;h1 id=&#34;investigate-traces-using-search-query-builder&#34;&gt;Investigate traces using Search query builder&lt;/h1&gt;
&lt;p&gt;Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results are returned faster because the queries limit what is searched.&lt;/p&gt;
&lt;p&gt;To learn more about how to query by TraceQL, refer to the &lt;a href=&#34;/docs/tempo/latest/traceql/&#34;&gt;TraceQL documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Search&lt;/strong&gt; query builder, located on the &lt;strong&gt;Explore&lt;/strong&gt; &amp;gt; &lt;strong&gt;Query type&lt;/strong&gt; &amp;gt; &lt;strong&gt;Search&lt;/strong&gt; in Grafana, provides drop-down lists and text fields to help you write a query.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png&#34;
  alt=&#34;The Search query builder&#34; width=&#34;1034&#34;
     height=&#34;859&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;enable-search-with-the-query-builder&#34;&gt;Enable Search with the query builder&lt;/h2&gt;
&lt;p&gt;This feature is automatically available in Grafana 10 (and newer) and Grafana Cloud.&lt;/p&gt;
&lt;p&gt;To enable the TraceQL query builder in self-hosted Grafana through version 10.1, 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/feature-toggles/&#34;&gt;enable the &lt;code&gt;traceqlSearch&lt;/code&gt; feature toggle&lt;/a&gt;.&lt;/p&gt;


&lt;div data-shared=&#34;datasources/tempo-search-traceql.md&#34;&gt;
            

&lt;h2 id=&#34;write-traceql-queries-using-search&#34;&gt;Write TraceQL queries using Search&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Search&lt;/strong&gt; query builder, located on the &lt;strong&gt;Explore&lt;/strong&gt; &amp;gt; &lt;strong&gt;Query type&lt;/strong&gt; &amp;gt; &lt;strong&gt;Search&lt;/strong&gt; in Grafana, provides drop-down lists and text fields to help you write a query.
The selections you make automatically generate a &lt;a href=&#34;/docs/tempo/latest/traceql/&#34;&gt;TraceQL query&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-search-v11.png&#34;
  alt=&#34;The Search query builder&#34; width=&#34;1011&#34;
     height=&#34;435&#34;/&gt;&lt;/p&gt;
&lt;p&gt;The builder lets you run the most common queries in as few clicks as possible. You don&amp;rsquo;t need to know the underlying query language or database architecture to use it.&lt;/p&gt;
&lt;p&gt;The builder supports a subset of TraceQL capabilities, including some structural operators (&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;=~&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;To access &lt;strong&gt;Search&lt;/strong&gt;, select your Tempo data source, and then choose &lt;strong&gt;Explore&lt;/strong&gt; and select &lt;strong&gt;Query type&lt;/strong&gt; &amp;gt; &lt;strong&gt;Search&lt;/strong&gt;.
You can use the query builder to search trace data by resource service name, span name, duration, one or more tags. The examples on this page use the default filters.&lt;/p&gt;
&lt;p&gt;In addition, you can add query builder blocks, view the query history, and use the &lt;strong&gt;Inspector&lt;/strong&gt; to see details.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 750px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=320 320w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=550 550w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=750 750w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=900 900w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=1040 1040w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=1240 1240w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Tempo Search query type&#34;width=&#34;1034&#34;height=&#34;859&#34;title=&#34;Screenshot of the Tempo Search query type&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-builder-v11.png&#34;
            alt=&#34;Screenshot of the Tempo Search query type&#34;width=&#34;1034&#34;height=&#34;859&#34;title=&#34;Screenshot of the Tempo Search query type&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Tempo Search query type&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;perform-a-search&#34;&gt;Perform a search&lt;/h3&gt;
&lt;p&gt;To perform a search, you need to select filters and then run the query. The results appear underneath the query builder.
The screenshot identifies the areas used to perform a search.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-build-numbered-v11.png&#34;
  alt=&#34;Parts of the Search query builder&#34; width=&#34;1416&#34;
     height=&#34;624&#34;/&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Number&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Name&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Action&lt;/th&gt;
              &lt;th style=&#34;text-align: left&#34;&gt;Comment&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;1&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Data source&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Use the data source drop-down list to select a Tempo data source.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Each data source has its own version of search. This &lt;strong&gt;Search&lt;/strong&gt; is specific to the Tempo data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;2&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Query type&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Select &lt;strong&gt;Search&lt;/strong&gt;.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;3&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Choose filter&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Choose one or more of the filters.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Optional. You can execute an empty query in the Search tab. In TraceQL, &lt;code&gt;{}&lt;/code&gt; is a valid query and is the default query to provide a list of all traces or spans.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;4&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Filters conditions&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Select options for one or more filters. For example, you can define a filter where &lt;strong&gt;Service Name&lt;/strong&gt; (&lt;code&gt;resource.service.name&lt;/code&gt;) equals (&lt;code&gt;=&lt;/code&gt;) &lt;code&gt;user&lt;/code&gt;.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Optional. At least one tag or filter must be defined.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;5&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Tags and Aggregate by&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Add tags for span, resource, or unscoped and define their conditions. Use &lt;strong&gt;Aggregate by&lt;/strong&gt; to group results.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Optional.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;6&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;TraceQL query&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;Displays the TraceQL query constructed by your selections.&lt;/td&gt;
              &lt;td style=&#34;text-align: left&#34;&gt;This TraceQL query is executed when you select &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Every query searches the data for the selected time frame.
By default, queries run against data from the last hour.
Select &lt;strong&gt;Time range&lt;/strong&gt; to the left of &lt;strong&gt;Run query&lt;/strong&gt; to choose the time range for the data your query runs against.
Read the &lt;a href=&#34;/docs/grafana/latest/dashboards/use-dashboards/#set-dashboard-time-range&#34;&gt;dashboard time range&lt;/a&gt; documentation to learn more.&lt;/p&gt;
&lt;p&gt;To access the &lt;strong&gt;Search&lt;/strong&gt; query builder, use the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sign into Grafana.&lt;/li&gt;
&lt;li&gt;Select your Tempo data source.&lt;/li&gt;
&lt;li&gt;From the menu, choose &lt;strong&gt;Explore&lt;/strong&gt; and select &lt;strong&gt;Query type &amp;gt; Search&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;define-filters&#34;&gt;Define filters&lt;/h3&gt;
&lt;p&gt;Using filters, you refine the data returned from the query by selecting &lt;strong&gt;Service Name&lt;/strong&gt;, &lt;strong&gt;Span Name&lt;/strong&gt;, &lt;strong&gt;Status&lt;/strong&gt;, or &lt;strong&gt;Duration&lt;/strong&gt;.
&lt;strong&gt;Duration&lt;/strong&gt; represents span time, calculated by subtracting the end time from the start time of the span.&lt;/p&gt;
&lt;p&gt;Grafana administrators can change the default filters using the Tempo data source configuration.
Filters can be limited by the operators.
The field type determines the available operators.
For example, &lt;strong&gt;Span Name&lt;/strong&gt; and &lt;strong&gt;Service Name&lt;/strong&gt; are string fields so the comparison operators are equals (&lt;code&gt;=&lt;/code&gt;), not equal (&lt;code&gt;!=&lt;/code&gt;), matches regular expressions (&lt;code&gt;=~&lt;/code&gt;), or doesn&amp;rsquo;t match regular expression (&lt;code&gt;!~&lt;/code&gt;).
&lt;strong&gt;Duration&lt;/strong&gt; is a duration field type and uses range selections (&lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;gt;=&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;lt;=&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;When you select multiple values for the same filter, Grafana automatically changes the operator to the regular expression (regex) operator &lt;code&gt;=~&lt;/code&gt; and concatenates the values with a &lt;code&gt;|&lt;/code&gt;.
This capability only applies to fields with drop-down value selection.&lt;/p&gt;
&lt;p&gt;For example, if you choose &lt;strong&gt;Span Name&lt;/strong&gt; &lt;code&gt;= get&lt;/code&gt; and then &lt;strong&gt;Span Name&lt;/strong&gt; &lt;code&gt;= log_results_cache,&lt;/code&gt; operator drop-down list changes from &lt;code&gt;=&lt;/code&gt; to &lt;code&gt;=~&lt;/code&gt; and both &lt;code&gt;get&lt;/code&gt; and &lt;code&gt;log_results_cache&lt;/code&gt; are listed in the &lt;strong&gt;Span Name&lt;/strong&gt; field.
The resulting query is updated with this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{duration&amp;gt;5ms &amp;amp;&amp;amp; duration&amp;lt;10ms &amp;amp;&amp;amp; name=~&amp;quot;get|log_results_cache&amp;quot;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To define filters, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Choose one of the filters.&lt;/li&gt;
&lt;li&gt;Select a comparison operator from the drop-down.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service Name&lt;/strong&gt;, &lt;strong&gt;Span Name&lt;/strong&gt;, and &lt;strong&gt;Status&lt;/strong&gt; only: Select one or more values from the drop-down.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Duration&lt;/strong&gt; only: Enter values and units for the range and choose comparison operators for the drop-downs. Units can be nanoseconds (&lt;code&gt;ns&lt;/code&gt;), milliseconds (&lt;code&gt;ms&lt;/code&gt;), seconds (&lt;code&gt;s&lt;/code&gt;), minutes (&lt;code&gt;m&lt;/code&gt;), and hours (&lt;code&gt;h&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can either select &lt;strong&gt;Run query&lt;/strong&gt; to execute the query or define tags and then run the query.&lt;/p&gt;
&lt;h4 id=&#34;define-tags&#34;&gt;Define tags&lt;/h4&gt;
&lt;p&gt;You can add any tags to your query to further filter the results.
Tags can be selected by scoped (span or resource) or unscoped.
If you select unscoped, then all tags are searched for matches.&lt;/p&gt;
&lt;p&gt;To add a tag, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select span, resource, or unscoped.&lt;/li&gt;
&lt;li&gt;Select a tag from the &lt;strong&gt;Select tag&lt;/strong&gt; drop-down.&lt;/li&gt;
&lt;li&gt;Select a comparison operator.&lt;/li&gt;
&lt;li&gt;Select a value from the &lt;strong&gt;Select value&lt;/strong&gt; drop-down. This field is populated based upon the tag.&lt;/li&gt;
&lt;li&gt;Optional: Select &lt;strong&gt;&#43;&lt;/strong&gt; to add another tag.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;optional-use-aggregate-by&#34;&gt;Optional: Use Aggregate by&lt;/h4&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Metrics summary API and the &lt;strong&gt;Aggregate by&lt;/strong&gt; feature are deprecated in Grafana Cloud and Grafana 11.3 and later.
It will be removed in a future release.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Using &lt;strong&gt;Aggregate by&lt;/strong&gt;, you can calculate RED metrics (total span count, percent erroring spans, and latency information) for spans of &lt;code&gt;kind=server&lt;/code&gt; that match your filter criteria, grouped by one or more attributes.
This capability is based on the &lt;a href=&#34;/docs/grafana-cloud/monitor-infrastructure/traces/metrics-summary-api/&#34;&gt;metrics summary API&lt;/a&gt;.
Metrics summary only calculates summaries based on spans received within the last hour.
For additional information, refer to &lt;a href=&#34;/blog/2023/12/07/traces-to-metrics-ad-hoc-red-metrics-in-grafana-tempo-with-aggregate-by/&#34;&gt;Traces to metrics: Ad-hoc RED metrics in Grafana Tempo with &lt;code&gt;Aggregate by&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;!--Impromptu RED metrics with Aggregate by --&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/xOolCpm2F8c&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;strong&gt;Aggregate by&lt;/strong&gt; is disabled by default.
&lt;a href=&#34;/docs/grafana/latest/setup-grafana/configure-grafana/feature-toggles/&#34;&gt;Enable the &lt;code&gt;metricsSummary&lt;/code&gt; feature toggle&lt;/a&gt; in Grafana to use this feature.&lt;/p&gt;
&lt;p&gt;Your Grafana Tempo data source must also point to a Tempo database with the &lt;a href=&#34;/docs/tempo/latest/api_docs/metrics-summary/&#34;&gt;Metrics Summary API&lt;/a&gt; enabled.
Contact Grafana Support to enable this feature in Grafana Cloud.&lt;/p&gt;
&lt;h5 id=&#34;use-aggregate-by&#34;&gt;Use Aggregate by&lt;/h5&gt;
&lt;p&gt;When you use &lt;strong&gt;Aggregate by&lt;/strong&gt;, the selections you make determine how the information is reported in the Table.
Every combination that matches selections in your data is listed in the table.
Each aggregate value, for example &lt;code&gt;intrinsic&lt;/code&gt;:&lt;code&gt;name&lt;/code&gt;, has a corresponding column in the results table.&lt;/p&gt;
&lt;p&gt;For example, &lt;strong&gt;names&lt;/strong&gt; matching &lt;code&gt;GET /:endpoint&lt;/code&gt; with a &lt;strong&gt;span.http.user_agent&lt;/strong&gt; of &lt;code&gt;k6/0.46&lt;/code&gt; appeared in 31,466 spans. Instead of being listed by traces and associated spans, the query results are grouped by the selections in &lt;strong&gt;Aggregate by&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The RED metrics are calculated for every name and user agent combination found in your data.&lt;/p&gt;
&lt;p&gt;The screenshot shows all of the successful HTTP &lt;code&gt;status_code&lt;/code&gt; API calls against the &lt;code&gt;mystical-server&lt;/code&gt; service.
The results are shown in the same order used in &lt;strong&gt;Aggregate by&lt;/strong&gt;.
For example, &lt;strong&gt;Aggregate by&lt;/strong&gt; lists &lt;code&gt;intrinsic.name&lt;/code&gt; followed by &lt;code&gt;span.http.user_agent&lt;/code&gt;.
The first column in the results Table shows &lt;strong&gt;name&lt;/strong&gt; and then &lt;strong&gt;span.http.user_agent&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-build-aggregate-v11-a.png&#34;
  alt=&#34;Use Aggregate by to calculate RED metrics for spans and group by attributes&#34; width=&#34;1412&#34;
     height=&#34;925&#34;/&gt;&lt;/p&gt;
&lt;p&gt;To use this capability:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the &lt;strong&gt;Aggregate by&lt;/strong&gt; row, select a scope from the first drop-down box. For example, &lt;code&gt;span&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select an attribute from the second drop-down.&lt;/li&gt;
&lt;li&gt;Optional: Select &lt;strong&gt;&#43;&lt;/strong&gt; to add an &lt;strong&gt;Aggregate by&lt;/strong&gt; row.&lt;/li&gt;
&lt;li&gt;Optional: Select a &lt;strong&gt;Time range&lt;/strong&gt; to expand or narrow the data set for an hour&amp;rsquo;s range.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- Explanation of how to use feature --&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/g97CjKOZqT4&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h4 id=&#34;optional-add-query-and-service-graph-blocks&#34;&gt;Optional: Add query and service graph blocks&lt;/h4&gt;
&lt;p&gt;Using &lt;strong&gt;Add query&lt;/strong&gt;, you can have successive query or service node blocks that run in sequential order.
For example, query A runs and then query B.
You can reorder the queries by dragging and dropping them above or below other queries.
Select &lt;strong&gt;&#43; Add query&lt;/strong&gt; to add another query block.&lt;/p&gt;
&lt;p&gt;For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/query-editor/&#34;&gt;Use query types together&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;run-queries-and-view-results&#34;&gt;Run queries and view results&lt;/h3&gt;
&lt;p&gt;Select &lt;strong&gt;Run query&lt;/strong&gt; to run the TraceQL query (1 in the screenshot).&lt;/p&gt;
&lt;p&gt;Queries can take a little while to return results. The results appear in a table underneath the query builder.
Selecting a Trace ID (2 in the screenshot) displays more detailed information (3 in the screenshot).
&lt;strong&gt;Span Filters&lt;/strong&gt; (4 in the screenshot) provide an additional to refine the query results.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-results-numbered-v11.png&#34;
  alt=&#34;Query results with numbered sections&#34; width=&#34;1482&#34;
     height=&#34;1037&#34;/&gt;&lt;/p&gt;
&lt;h4 id=&#34;stream-results&#34;&gt;Stream results&lt;/h4&gt;
&lt;p&gt;The Tempo data source supports streaming responses to TraceQL queries so you can see partial query results as they come in without waiting for the whole query to finish.&lt;/p&gt;
&lt;p&gt;When active, all configured Tempo data sources attempt to use streaming.
You can activate and control which Tempo data sources do and don&amp;rsquo;t attempt to stream results at the per-data source level using the &lt;strong&gt;Streaming&lt;/strong&gt; section of the Tempo data source configuration.
For more information, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#streaming&#34;&gt;Tempo data source&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;Streaming is available for both the &lt;strong&gt;Search&lt;/strong&gt; and &lt;strong&gt;TraceQL&lt;/strong&gt; query types.
You&amp;rsquo;ll get immediate visibility of incoming traces on the results table.&lt;/p&gt;
&lt;div class=&#34;&#34;&gt;
  &lt;figure class=&#34;p-0 m-0 &#34;&gt;
    &lt;video 
      width=&#34;&#34; 
      controls
      muted
      playsinline
      
        class=&#34;lazyload&#34;
        preload=&#34;none&#34;
        
             
      
      
        loop
      
      src=&#34;/media/docs/grafana/data-sources/tempo-streaming-v2.mp4&#34;
      type=&#34;video/mp4&#34;
    &gt;
    &lt;/video&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;h4 id=&#34;use-filters-and-tags-on-spans&#34;&gt;Use filters and tags on spans&lt;/h4&gt;
&lt;p&gt;Using &lt;strong&gt;Span Filters&lt;/strong&gt;, you can use filters to refine results when viewing span details.
These filters are available when viewing details for a trace.&lt;/p&gt;
&lt;p&gt;You can continue to apply filters until you have narrowed down your resulting spans to the select few you are most interested in.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Service Name&lt;/strong&gt;, &lt;strong&gt;Span Name&lt;/strong&gt;, &lt;strong&gt;Duration&lt;/strong&gt;, and &lt;strong&gt;Tags&lt;/strong&gt; have the same function and operation as the filters of the same name in the &lt;strong&gt;Search&lt;/strong&gt; query builder.&lt;/p&gt;
&lt;p&gt;In addition, you can search for a keyword, opt to &lt;strong&gt;Show matches only&lt;/strong&gt;, opt to &lt;strong&gt;Show critical path only&lt;/strong&gt;, and browse matches using &lt;strong&gt;Prev&lt;/strong&gt; and &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Use &lt;strong&gt;Clear&lt;/strong&gt; to reset the filters.&lt;/p&gt;

  &lt;/div&gt;

        
]]></content><description>&lt;h1 id="investigate-traces-using-search-query-builder">Investigate traces using Search query builder&lt;/h1>
&lt;p>Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results are returned faster because the queries limit what is searched.&lt;/p></description></item><item><title>Write TraceQL queries with the editor</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-editor/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-editor/</guid><content><![CDATA[&lt;h1 id=&#34;write-traceql-queries-with-the-editor&#34;&gt;Write TraceQL queries with the editor&lt;/h1&gt;


&lt;div data-shared=&#34;datasources/tempo-editor-traceql.md&#34;&gt;
            &lt;!-- # Write TraceQL queries using the query editor --&gt;
&lt;p&gt;Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results are returned faster because the queries limit what is searched.&lt;/p&gt;
&lt;p&gt;To learn more about how to query by TraceQL, refer to the &lt;a href=&#34;/docs/tempo/latest/traceql/&#34;&gt;TraceQL documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The TraceQL query editor in Grafana &lt;strong&gt;Explore&lt;/strong&gt; lets you search by trace ID and write TraceQL queries using autocomplete.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-traceql-v11.png&#34;
  alt=&#34;The TraceQL query editor&#34; width=&#34;1007&#34;
     height=&#34;277&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;This feature is automatically available in Grafana 10 (and newer) and Grafana Cloud.&lt;/p&gt;
&lt;p&gt;To use the TraceQL query editor in self-hosted Grafana 9.3.2 and older, you need to &lt;a href=&#34;/docs/grafana/latest/setup-grafana/configure-grafana/feature-toggles/&#34;&gt;enable the &lt;code&gt;traceqlEditor&lt;/code&gt; feature toggle&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;streaming-and-grpc&#34;&gt;Streaming and gRPC&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re trying to query a self-managed Grafana Tempo or Grafana Enterprise Traces database with a gateway, such as nginx, in front of it from your hosted Grafana, that gateway (for example, nginx) must allow gRPC connections.
If it doesn&amp;rsquo;t, streaming won&amp;rsquo;t work and queries will fail to return results.&lt;/p&gt;
&lt;p&gt;If you can&amp;rsquo;t configure your gateway to allow gRPC, deactivate streaming in your hosted Grafana.
In Grafana 11.2 and newer, you can deactivate the &lt;strong&gt;Streaming&lt;/strong&gt; option in your Tempo data source settings from &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt; in the Grafana main menu.
You can also open a support escalation to request streaming query results be disabled in your hosted Grafana.&lt;/p&gt;
&lt;h2 id=&#34;write-traceql-queries-using-the-query-editor&#34;&gt;Write TraceQL queries using the query editor&lt;/h2&gt;
&lt;p&gt;The Tempo data source’s TraceQL query editor helps you query and display traces from Tempo in &lt;strong&gt;Explore&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;To access the query editor, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Sign into Grafana or Grafana Cloud.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Explore&lt;/strong&gt; from the main menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a Tempo data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;TraceQL&lt;/strong&gt; tab.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start your query on the text line by entering &lt;code&gt;{&lt;/code&gt;. For help with TraceQL syntax, refer to the &lt;a href=&#34;/docs/tempo/latest/traceql/#construct-a-traceql-query&#34;&gt;Construct a TraceQL query documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Optional: Select &lt;strong&gt;Copy query from Search&lt;/strong&gt; to transfer a builder query to the editor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Use the &lt;strong&gt;Time picker&lt;/strong&gt; drop-down list to change the time and range for the query (refer to the &lt;a href=&#34;/docs/grafana/latest/dashboards/use-dashboards/#set-dashboard-time-range&#34;&gt;documentation for instructions&lt;/a&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once you&amp;rsquo;ve finished your query, select &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-ed-example-v11-a.png&#34;
  alt=&#34;Query editor showing span results&#34; width=&#34;1367&#34;
     height=&#34;908&#34;/&gt;&lt;/p&gt;
&lt;p&gt;This video provides an example of creating a TraceQL query using the custom tag grouping.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/fraepWra00Y&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h2 id=&#34;query-by-traceid&#34;&gt;Query by TraceID&lt;/h2&gt;
&lt;p&gt;To query a particular trace by its trace ID:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From the menu, choose &lt;strong&gt;Explore&lt;/strong&gt;, select the desired Tempo data source, and navigate to the &lt;strong&gt;TraceQL&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Enter the trace ID into the query field. For example: &lt;code&gt;41928b92edf1cdbe0ba6594baee5ae9&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Run query&lt;/strong&gt; or use the keyboard shortcut Shift &#43; Enter.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-trace-id-v11.png&#34;
  alt=&#34;Search for a trace ID using the TraceQL query editor&#34; width=&#34;1022&#34;
     height=&#34;693&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;use-autocomplete-to-write-queries&#34;&gt;Use autocomplete to write queries&lt;/h2&gt;
&lt;p&gt;You can use the query editor’s autocomplete suggestions to write queries.
The editor detects spansets to provide relevant autocomplete options.
It uses regular expressions (regex) to detect where it&amp;rsquo;s inside a spanset and provide attribute names, scopes, intrinsic names, logic operators, or attribute values from the Tempo API, depending on what&amp;rsquo;s expected for the current situation.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-editor-autocomplete.png&#34;
  alt=&#34;Query editor showing the auto-complete feature&#34; width=&#34;1014&#34;
     height=&#34;290&#34;/&gt;&lt;/p&gt;
&lt;h3 id=&#34;anchored-regular-expressions&#34;&gt;Anchored regular expressions&lt;/h3&gt;
&lt;p&gt;Regular expressions are anchored at both ends.
This anchoring makes the queries faster and matches the behavior of PromQL, where regular expressions are also fully anchored.&lt;/p&gt;
&lt;p&gt;An unanchored query, such as:
&lt;code&gt;{ span.foo =~ &amp;quot;bar&amp;quot; }&lt;/code&gt;
is now treated as:
&lt;code&gt;{ span.foo =~ &amp;quot;^bar$&amp;quot; }&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you use TraceQL with regular expressions in your Grafana dashboards and you want the unanchored behavior, update the queries to use the unanchored version, such as &lt;code&gt;{ span.foo =~ &amp;quot;.*bar.*&amp;quot;}&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;create-a-query-with-autocomplete&#34;&gt;Create a query with autocomplete&lt;/h3&gt;
&lt;p&gt;To create a query using autocomplete, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the menu, choose &lt;strong&gt;Explore&lt;/strong&gt;, select the desired Tempo data source, and navigate to the &lt;strong&gt;TraceQL&lt;/strong&gt; tab.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter your query. As you type your query, autocomplete suggestions appear as a drop-down. Each letter you enter refines the autocomplete options to match.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use your mouse or arrow keys to select any option you wish. When the desired option is highlighted, press Tab on your keyboard to add the selection to your query.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once your query is complete, select &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;view-query-results&#34;&gt;View query results&lt;/h2&gt;
&lt;p&gt;Query results appear in a table, such as &lt;strong&gt;Table - Traces&lt;/strong&gt;, under the query editor.
Each span (and the trace it belongs to) matching the query conditions is returned by the query.
If there are no filter conditions, all spans are matching and thus returned with their associated traces.&lt;/p&gt;
&lt;p&gt;A query is performed against a defined time interval, relative (for example, the last 3 hours) or absolute (for example, from X date-time to Y date-time).
The query response is also limited by the number of traces (&lt;strong&gt;Limit&lt;/strong&gt;) and spans per spanset (&lt;strong&gt;Span Limit&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/tempo/traceql/TraceQL-in-Grafana-v11.png&#34;
  alt=&#34;TraceQL in Grafana&#34; width=&#34;3006&#34;
     height=&#34;1544&#34;/&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;TraceQL query editor&lt;/li&gt;
&lt;li&gt;Query options: &lt;strong&gt;Limit&lt;/strong&gt;, &lt;strong&gt;Span Limit&lt;/strong&gt; and &lt;strong&gt;Table Format&lt;/strong&gt; (Traces or Spans).&lt;/li&gt;
&lt;li&gt;Trace (by Trace ID). The &lt;strong&gt;Name&lt;/strong&gt; and &lt;strong&gt;Service&lt;/strong&gt; columns are displaying the trace root span name and associated service.&lt;/li&gt;
&lt;li&gt;Spans associated with the Trace.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Selecting the trace ID from the returned results opens a trace diagram.
Selecting a span from the returned results opens a trace diagram and reveals the relevant span in the trace diagram.&lt;/p&gt;
&lt;p&gt;For more information on span details, refer to &lt;a href=&#34;/docs/grafana/latest/explore/trace-integration/#span-details&#34;&gt;Traces in Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-span-details-v11.png&#34;
  alt=&#34;Selecting a trace ID or a span to view span details&#34; width=&#34;1481&#34;
     height=&#34;1068&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Querying spansets with a large number of spans can negatively impact performance.
You can use the &lt;strong&gt;Span Limit&lt;/strong&gt; field in &lt;strong&gt;Options&lt;/strong&gt; section of the TraceQL query editor.
This field sets the maximum number of spans to return for each span set.
By default, the maximum value that you can set for the &lt;strong&gt;Span Limit&lt;/strong&gt; value (or the spss query) is 100.
In Tempo configuration, this value is controlled by the &lt;code&gt;max_spans_per_span_set&lt;/code&gt; parameter and can be modified by your Tempo administrator.
Entering a value higher than the default results in an error.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Changing the value of &lt;code&gt;max_spans_per_span_set&lt;/code&gt; isn&amp;rsquo;t supported in Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;focus-on-traces-or-spans&#34;&gt;Focus on traces or spans&lt;/h3&gt;
&lt;p&gt;Under &lt;strong&gt;Options&lt;/strong&gt;, you can choose to display the table as &lt;strong&gt;Traces&lt;/strong&gt; or &lt;strong&gt;Spans&lt;/strong&gt; focused.&lt;/p&gt;
&lt;p&gt;When the &lt;strong&gt;Table Type&lt;/strong&gt; option is set to &lt;strong&gt;Spans&lt;/strong&gt;, the traces and spansets are flattened into a list of spans.
The trace service and trace name are added to the row of each span to add context.&lt;/p&gt;
&lt;p&gt;Using the &lt;strong&gt;Spans&lt;/strong&gt; option makes it easier access the spans to apply transformations and plot them in dashboards.&lt;/p&gt;
&lt;h3 id=&#34;stream-results&#34;&gt;Stream results&lt;/h3&gt;
&lt;p&gt;The Tempo data source supports streaming responses to TraceQL queries so you can see partial query results as they come in without waiting for the whole query to finish.&lt;/p&gt;
&lt;p&gt;Streaming is available for both the &lt;strong&gt;Search&lt;/strong&gt; and &lt;strong&gt;TraceQL&lt;/strong&gt; query types, and you&amp;rsquo;ll get immediate visibility of incoming traces on the results table.&lt;/p&gt;
&lt;p&gt;To learn how to activate streaming, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#streaming&#34;&gt;Streaming&lt;/a&gt; in the Tempo data source documentation.&lt;/p&gt;
&lt;div class=&#34;&#34;&gt;
  &lt;figure class=&#34;p-0 m-0 &#34;&gt;
    &lt;video 
      width=&#34;&#34; 
      controls
      muted
      playsinline
      
        class=&#34;lazyload&#34;
        preload=&#34;none&#34;
        
             
      
      
        loop
      
      src=&#34;/media/docs/grafana/data-sources/tempo-streaming-v2.mp4&#34;
      type=&#34;video/mp4&#34;
    &gt;
    &lt;/video&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="write-traceql-queries-with-the-editor">Write TraceQL queries with the editor&lt;/h1>
&lt;div data-shared="datasources/tempo-editor-traceql.md">
&lt;!-- # Write TraceQL queries using the query editor -->
&lt;p>Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results are returned faster because the queries limit what is searched.&lt;/p></description></item></channel></rss>