<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tempo data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/</link><description>Recent content in Tempo data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/datasources/tempo/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure the Tempo data source</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/</guid><content><![CDATA[&lt;h1 id=&#34;configure-a-tempo-data-source&#34;&gt;Configure a Tempo data source&lt;/h1&gt;
&lt;p&gt;The Tempo data source sets how Grafana connects to your Tempo database and lets you configure features and integrations with other telemetry signals.&lt;/p&gt;
&lt;p&gt;You can configure the data source using either the data source interface in Grafana or using a configuration file.
This page explains how to set up and enable the data source capabilities using Grafana.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using your own installation of Grafana, you can provision the Tempo data source using a YAML configuration file.&lt;/p&gt;
&lt;p&gt;Depending upon your tracing environment, you may have more than one Tempo instance.
Grafana supports multiple Tempo data sources.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To configure a Tempo data source, you need administrator rights to your Grafana instance and a Tempo instance configured to send tracing data to Grafana.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re provisioning a Tempo data source, then you also need administrative rights on the server hosting your Grafana instance.
Refer to &lt;a href=&#34;#provision-the-data-source&#34;&gt;Provision the data source&lt;/a&gt; for next steps.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-data-source-provisioned-error.png&#34;
  alt=&#34;Provisioned data source warning&#34; width=&#34;1143&#34;
     height=&#34;385&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;add-or-modify-a-data-source&#34;&gt;Add or modify a data source&lt;/h2&gt;
&lt;p&gt;You can use these procedures to configure a new Tempo data source or to edit an existing one.&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;You can&amp;rsquo;t modify a provisioned data source using the Tempo data source settings in Grafana Cloud.&lt;/p&gt;
&lt;p&gt;If you want to modify any capabilities of a provisioned data source, you can clone the provisioned data source and then edit the new data source in the Grafana UI.
Refer to &lt;a href=&#34;#clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;Clone a provisioned data source for Grafana Cloud&lt;/a&gt; for more information.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;add-a-new-data-source&#34;&gt;Add a new data source&lt;/h3&gt;
&lt;p&gt;Follow these steps to set up a new Tempo data source:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Connections&lt;/strong&gt; in the main menu.&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;Tempo&lt;/code&gt; in the search bar.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Tempo&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Add new data source&lt;/strong&gt; in the top-right corner of the page.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;Settings&lt;/strong&gt; tab, complete the &lt;strong&gt;Name&lt;/strong&gt;, &lt;strong&gt;Connection&lt;/strong&gt;, and &lt;strong&gt;Authentication&lt;/strong&gt; sections.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Use the &lt;strong&gt;Name&lt;/strong&gt; field to specify the name used for the data source in panels, queries, and Explore. Toggle the &lt;strong&gt;Default&lt;/strong&gt; switch for the data source to be pre-selected for new panels.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Connection&lt;/strong&gt;, enter the &lt;strong&gt;URL&lt;/strong&gt; of the Tempo instance, for example, &lt;code&gt;https://example.com:4100&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Complete the &lt;a href=&#34;#authentication&#34;&gt;&lt;strong&gt;Authentication&lt;/strong&gt; section&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;Optional: Configure other sections to add capabilities to your tracing data. Refer to the additional procedures for instructions.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;update-an-existing-data-source&#34;&gt;Update an existing data source&lt;/h3&gt;
&lt;p&gt;To modify an existing Tempo data source:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Connections&lt;/strong&gt; in the main menu.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data sources&lt;/strong&gt; to view a list of configured data sources.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source you wish to modify.&lt;/li&gt;
&lt;li&gt;Configure or update additional sections to add capabilities to your tracing data. Refer to the additional procedures for instructions.&lt;/li&gt;
&lt;li&gt;After completing your updates, select &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;authentication&#34;&gt;Authentication&lt;/h2&gt;
&lt;p&gt;Use this section to select an authentication method to access the data source.&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;Use Transport Layer Security (TLS) for an additional layer of security when working with Tempo.
For additional information on setting up TLS encryption with Tempo, refer to 
    &lt;a href=&#34;/docs/tempo/latest/configuration/network/tls/&#34;&gt;Configure TLS communication&lt;/a&gt; and 
    &lt;a href=&#34;/docs/tempo/latest/configuration/&#34;&gt;Tempo configuration&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div data-shared=&#34;datasources/datasouce-authentication.md&#34;&gt;
            

&lt;!-- Authentication procedure from shared file --&gt;
&lt;p&gt;To set up authentication:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select an authentication method from the drop-down list:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Basic authentication&lt;/strong&gt;: Authenticates your data source using a username and password&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Forward OAuth identity&lt;/strong&gt;: Forwards the OAuth access token and the OIDC ID token, if available, of the user querying to the data source&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No authentication&lt;/strong&gt;: No authentication is required to access the data source&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For &lt;strong&gt;Basic authentication&lt;/strong&gt; only: Enter the &lt;strong&gt;User&lt;/strong&gt; and &lt;strong&gt;Password&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Complete the &lt;strong&gt;TLS settings&lt;/strong&gt; for additional security methods.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;strong&gt;TLS Client Authentication&lt;/strong&gt;&lt;/dt&gt;
&lt;dd&gt;Toggle on to use client authentication. When enabled, it adds the &lt;strong&gt;Server name&lt;/strong&gt;, &lt;strong&gt;Client cert&lt;/strong&gt;, and &lt;strong&gt;Client key&lt;/strong&gt; fields. The client provides a certificate that is validated by the server to establish the client&amp;rsquo;s trusted identity. The client key encrypts the data between client and server. These details are encrypted and stored in the Grafana database.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Add self-signed certificate&lt;/strong&gt;&lt;/dt&gt;
&lt;dd&gt;Activate this option to use a self-signed TLS certificate. You can add your own Certificate Authority (CA) certificate on top of one generated by the certificate authorities for additional security measure.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Skip TLS certification validation&lt;/strong&gt;&lt;/dt&gt;
&lt;dd&gt;When activated, it bypasses TLS certificate verification. Not recommended, unless absolutely necessary for testing.
&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-data-source-authentication.png&#34;
  alt=&#34;Authentication section showing the TLS client certificate options&#34; width=&#34;633&#34;
     height=&#34;914&#34;/&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add &lt;strong&gt;HTTP Headers&lt;/strong&gt;. You can pass along additional context and metadata data about the request and response. Select &lt;strong&gt;Add header&lt;/strong&gt; to add &lt;strong&gt;Header&lt;/strong&gt; and &lt;strong&gt;Value&lt;/strong&gt; fields.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; to preserve your changes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

  &lt;/div&gt;

        
&lt;h2 id=&#34;streaming&#34;&gt;Streaming&lt;/h2&gt;
&lt;p&gt;Streaming enables TraceQL query results to be displayed as they become available.
Without streaming, no results are displayed until all results have returned.&lt;/p&gt;
&lt;p&gt;To use streaming, you need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Run Tempo version 2.2 or later, or Grafana Enterprise Traces (GET) version 2.2 or later, or use Grafana Cloud Traces.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tempo must have &lt;code&gt;stream_over_http_enabled: true&lt;/code&gt; for streaming to work.&lt;/p&gt;
&lt;p&gt;For more information, refer to 
    &lt;a href=&#34;/docs/tempo/latest/api_docs/#tempo-grpc-api&#34;&gt;Tempo gRPC API&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For self-managed Tempo or GET instances: If your Tempo or GET instance is behind a load balancer or proxy that doesn&amp;rsquo;t supporting gRPC or HTTP2, streaming may not work and should be deactivated.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;activate-streaming&#34;&gt;Activate streaming&lt;/h3&gt;
&lt;p&gt;Streaming is available in Grafana and Grafana Cloud.
You can activate streaming by turning the &lt;strong&gt;Streaming&lt;/strong&gt; toggle to on in the Tempo data source.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo-data-source-streaming-v11.2.png&#34;
  alt=&#34;Streaming section in Tempo data source&#34; width=&#34;926&#34;
     height=&#34;255&#34;/&gt;&lt;/p&gt;
&lt;p&gt;When streaming is active, it&amp;rsquo;s shows as &lt;strong&gt;Enabled&lt;/strong&gt; in &lt;strong&gt;Explore&lt;/strong&gt;.
To check the status, select Explore in the menu, select your Tempo data source, and expand the &lt;strong&gt;Options&lt;/strong&gt; section.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-query-stream-active.png&#34;
  alt=&#34;The Explore screen shows the Tempo data source with streaming active&#34; width=&#34;1196&#34;
     height=&#34;778&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;trace-to-logs&#34;&gt;Trace to logs&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Trace to logs&lt;/strong&gt; setting configures 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/trace-integration/&#34;&gt;trace to logs&lt;/a&gt; that&amp;rsquo;s available when you integrate Grafana with Tempo.
Trace to logs can also be used with other tracing data sources, such as Jaeger and Zipkin.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-data-source-trace-to-logs.png&#34;
  alt=&#34;Trace to logs settings&#34; width=&#34;923&#34;
     height=&#34;332&#34;/&gt;&lt;/p&gt;
&lt;p&gt;You can configure a custom query where you can use a 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/variable-syntax/&#34;&gt;template language&lt;/a&gt; to interpolate variables from the trace or span.&lt;/p&gt;
&lt;h3 id=&#34;configure-a-custom-query&#34;&gt;Configure a custom query&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select the target data source from the drop-down list.&lt;/p&gt;
&lt;p&gt;You can also click &lt;strong&gt;Open advanced data source picker&lt;/strong&gt; to see more options, including adding a data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in the trace it may be necessary to widen or shift the time range to find the desired logs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Select tags to map. These tags can be used in the custom query with &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source. Only the tags that were present in the span are included; tags that aren&amp;rsquo;t present are omitted You can also configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn&amp;rsquo;t allow dots in labels. For example, you can remap &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;. If you don&amp;rsquo;t map any tags here, you can still use any tag in the query, for example, &lt;code&gt;method=&amp;quot;${__span.tags.method}&amp;quot;&lt;/code&gt;. You can learn more about custom query variables 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#custom-query-variables&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Skip &lt;strong&gt;Filter by trace ID&lt;/strong&gt; and &lt;strong&gt;Filter by span ID&lt;/strong&gt; settings as these cannot be used with a custom query.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch on &lt;strong&gt;Use custom query&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-trace-to-logs&#34;&gt;Configure trace to logs&lt;/h3&gt;
&lt;p&gt;The following table describes the ways in which you can configure your trace to logs settings:&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&gt;Setting name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source. You can select Loki or any compatible log store.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span start time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the start time for the logs query, based on the span&amp;rsquo;s start time. You can use time units, such as &lt;code&gt;5s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;3h&lt;/code&gt;. To extend the time to the past, use a negative value. Default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span end time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the end time for the logs query, based on the span&amp;rsquo;s end time. You can use time units. Default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags to use in the logs query. Default: &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;pod&lt;/code&gt;, &lt;code&gt;service.name&lt;/code&gt;, &lt;code&gt;service.namespace&lt;/code&gt;. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example, map &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by trace ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the trace ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by span ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the span ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Use custom query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles use of custom query with interpolation.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Input to write custom query. Use variable interpolation to customize it with variables from span.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;trace-to-metrics&#34;&gt;Trace to metrics&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Trace to metrics&lt;/strong&gt; setting configures the 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#trace-to-metrics&#34;&gt;trace to metrics feature&lt;/a&gt; available when integrating Grafana with Tempo.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/TkapvLeMMpc&#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;There are two ways to configure the trace to metrics feature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use a basic configuration with a default query, or&lt;/li&gt;
&lt;li&gt;Configure one or more custom queries where you can use a 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/variable-syntax/&#34;&gt;template language&lt;/a&gt; to interpolate variables from the trace or span.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;#trace-tometrics-configuration-options&#34;&gt;Trace to metrics configuration options&lt;/a&gt; section to learn about the available options.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-data-source-trace-to-metrics.png&#34;
  alt=&#34;Trace to metrics settings in the Tempo data source&#34; width=&#34;923&#34;
     height=&#34;272&#34;/&gt;&lt;/p&gt;
&lt;h3 id=&#34;set-up-a-simple-configuration&#34;&gt;Set up a simple configuration&lt;/h3&gt;
&lt;p&gt;To use a simple configuration, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a metrics data source from the &lt;strong&gt;Data source&lt;/strong&gt; drop-down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Change &lt;strong&gt;Span start time shift&lt;/strong&gt; and &lt;strong&gt;Span end time shift&lt;/strong&gt;. You can change one or both of these settings. The default start time shift is -2 minutes and 2 minutes for end time shift.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Choose any tags to use in the query. If left blank, the default values of &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;pod&lt;/code&gt;, &lt;code&gt;service.name&lt;/code&gt; and &lt;code&gt;service.namespace&lt;/code&gt; are used.&lt;/p&gt;
&lt;p&gt;The tags you configure must be present in the spans attributes or resources for a trace to metrics span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source doesn&amp;rsquo;t allow using dots in labels. In that case you can for example remap &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service_name&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don&amp;rsquo;t select &lt;strong&gt;Add query&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save and Test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-up-custom-queries&#34;&gt;Set up custom queries&lt;/h3&gt;
&lt;p&gt;To use custom queries, you need to configure the tags you’d like to include in the linked queries.
For each tag, the key is the span attribute name.
In cases where the attribute name would result in an invalid metrics query or doesn’t exactly match the desired label name, you can enter the label name as the second value.
For example, you could map the attribute &lt;code&gt;k8s.pod&lt;/code&gt; to the label &lt;code&gt;pod&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can interpolate the configured tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.
For example, when you configure the query &lt;code&gt;requests_total{$__tags}&lt;/code&gt; with the tags &lt;code&gt;k8s.pod=pod&lt;/code&gt; and &lt;code&gt;cluster&lt;/code&gt;, it results in &lt;code&gt;requests_total{pod=&amp;quot;nginx-554b9&amp;quot;, cluster=&amp;quot;us-east-1&amp;quot;}&lt;/code&gt;.
The label values are dynamically inserted based on the span attributes’ values.&lt;/p&gt;
&lt;p&gt;You can link to any metric you’d like, but metrics for span durations, counts, and errors filtered by service or span are a great starting point.&lt;/p&gt;
&lt;p&gt;To use custom queries with the configuration, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a metrics data source from the &lt;strong&gt;Data source&lt;/strong&gt; drop-down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Choose any tags to use in the query. If left blank, the default values of &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;pod&lt;/code&gt;, &lt;code&gt;service.name&lt;/code&gt; and &lt;code&gt;service.namespace&lt;/code&gt; are used.&lt;/p&gt;
&lt;p&gt;These tags can be used in the custom query with &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren’t present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn&amp;rsquo;t allow using dots in labels. For example, you can remap &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service_name&lt;/code&gt; in such a case. If you don’t map any tags here, you can still use any tag in the query like this &lt;code&gt;method=&amp;quot;${__span.tags.method}&amp;quot;&lt;/code&gt;. You can learn more about custom query variables 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#custom-query-variables&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add query&lt;/strong&gt; to add a custom query.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify a custom query to be used to query metrics data.&lt;/p&gt;
&lt;p&gt;Each linked query consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Link Label:&lt;/strong&gt; &lt;em&gt;(Optional)&lt;/em&gt; Descriptive label for the linked query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query:&lt;/strong&gt; The query ran when navigating from a trace to the metrics data source.
Interpolate tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.
For example, when you configure the query &lt;code&gt;requests_total{$__tags}&lt;/code&gt;with the tags &lt;code&gt;k8s.pod=pod&lt;/code&gt; and &lt;code&gt;cluster&lt;/code&gt;, the result looks like &lt;code&gt;requests_total{pod=&amp;quot;nginx-554b9&amp;quot;, cluster=&amp;quot;us-east-1&amp;quot;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save and Test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;trace-to-metrics-configuration-options&#34;&gt;Trace to metrics configuration options&lt;/h3&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&gt;Setting name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span start time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the start time for the metrics query, based on the span&amp;rsquo;s start time. You can use time units, such as &lt;code&gt;5s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;3h&lt;/code&gt;. To extend the time to the past, use a negative value. Default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span end time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the end time for the metrics query, based on the span&amp;rsquo;s end time. You can use time units. Default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map &lt;code&gt;k8s.pod&lt;/code&gt; to &lt;code&gt;pod&lt;/code&gt;. To interpolate these tags into queries, use the &lt;code&gt;$__tags&lt;/code&gt; keyword.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Link Label&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Descriptive label for the linked query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Input to write a custom query. Use variable interpolation to customize it with variables from span.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;trace-to-profiles&#34;&gt;Trace to profiles&lt;/h2&gt;


&lt;div data-shared=&#34;datasources/tempo-traces-to-profiles.md&#34;&gt;
            

&lt;!-- # Trace to profiles  --&gt;
&lt;p&gt;Using Trace to profiles, you can use Grafana’s ability to correlate different signals by adding the functionality to link between traces and profiles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Trace to profiles&lt;/strong&gt; lets you link your Grafana Pyroscope data source to tracing data.
When configured, this connection lets you run queries from a trace span into the profile data using &lt;strong&gt;Explore&lt;/strong&gt;.
Each span links to your queries. Clicking a link runs the query in a split panel.
If tags are configured, Grafana dynamically inserts the span attribute values into the query.
The query runs over the time range of the (span start time - 60) to (span end time &#43; 60 seconds).&lt;/p&gt;
&lt;p&gt;Embedded flame graphs are also inserted into each span details section that has a linked profile.
This lets you see resource consumption in a flame graph visualization for each span without having to navigate away from the current view.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/AG8VzfFMLxo&#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;There are two ways to configure the trace to profiles feature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use a basic configuration with default query, or&lt;/li&gt;
&lt;li&gt;Configure a custom query where you can use a template language to interpolate variables from the trace or span.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/grafana/data-sources/tempo/tempo-data-source-trace-to-profiles.png&#34;
  alt=&#34;Traces to profiles section in the Tempo data source&#34; width=&#34;919&#34;
     height=&#34;224&#34;/&gt;&lt;/p&gt;
&lt;h4 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h4&gt;
&lt;p&gt;Traces to profile requires a Tempo data source with Traces to profiles configured and a 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/grafana-pyroscope/&#34;&gt;Grafana Pyroscope data source&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As with traces, your application needs to be instrumented to emit profiling data. For more information, refer to 
    &lt;a href=&#34;/docs/pyroscope/latest/configure-client/trace-span-profiles/&#34;&gt;Linking tracing and profiling with span profiles&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;use-a-basic-configuration&#34;&gt;Use a basic configuration&lt;/h4&gt;
&lt;p&gt;To use a basic configuration, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the left menu, select &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select your configured Tempo data source from the &lt;strong&gt;Data source&lt;/strong&gt; list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scroll down to the &lt;strong&gt;Traces to profiles&lt;/strong&gt; section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a Pyroscope data source in the &lt;strong&gt;Data source&lt;/strong&gt; drop-down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add one or more tags to use in the query. If left blank, the default values of &lt;code&gt;service.name&lt;/code&gt; and &lt;code&gt;service.namespace&lt;/code&gt; are used.&lt;/p&gt;
&lt;p&gt;The tags you configure must be present in the spans attributes or resources for a trace-to-profiles span link to appear.&lt;/p&gt;
&lt;p&gt;You can optionally configure a new name for the tag. This is useful if the tag has dots in the name and the target data source doesn&amp;rsquo;t allow dots in labels. In that case, you can remap &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service_name&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.&lt;/p&gt;
&lt;p&gt;The profile type or app must be selected for the query to be valid. Grafana doesn&amp;rsquo;t show any data if the profile type or app isn’t selected when a query runs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save and Test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you have configured a Pyroscope data source and no profile data is available or the &lt;strong&gt;Profiles for this span&lt;/strong&gt;
button and the embedded flame graph isn&amp;rsquo;t visible, verify that the &lt;code&gt;pyroscope.profile.id&lt;/code&gt; key-value pair exists in your span tags.&lt;/p&gt;
&lt;h4 id=&#34;configure-custom-query-traces-profiles&#34;&gt;Configure a custom query&lt;/h4&gt;
&lt;p&gt;To use a custom query with the configuration, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the left menu, select &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a configured Tempo data source from the &lt;strong&gt;Data source&lt;/strong&gt; list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scroll down to the &lt;strong&gt;Traces to profiles&lt;/strong&gt; section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select a Pyroscope data source in the &lt;strong&gt;Data source&lt;/strong&gt; drop-down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Choose any tags to use in the query. If left blank, the default values of &lt;code&gt;service.name&lt;/code&gt; and &lt;code&gt;service.namespace&lt;/code&gt; are used.&lt;/p&gt;
&lt;p&gt;These tags can be used in the custom query with &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source. Only tags present in the span are included. Tags that aren&amp;rsquo;t present are omitted.&lt;/p&gt;
&lt;p&gt;You can also configure a name for the tag. Tag names are useful where the tag has dots in the name and the target data source doesn&amp;rsquo;t allow using dots in labels. For example, you can remap &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service_name&lt;/code&gt;. If you don’t map any tags here, you can still use any tag in the query, for example: &lt;code&gt;method=&amp;quot;${__span.tags.method}&amp;quot;&lt;/code&gt;. Learn more about 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#custom-query-variables&#34;&gt;custom query variables&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch on &lt;strong&gt;Use custom query&lt;/strong&gt; to enter a custom query.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify a custom query to be used to query profile data. You can use various variables to make that query relevant for current span. The link shows only if all the variables are interpolated with non-empty values to prevent creating an invalid query. You can interpolate the configured tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save and Test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h4&gt;
&lt;p&gt;The following table describes options for configuring your &lt;strong&gt;Trace to profiles&lt;/strong&gt; settings:&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&gt;Setting name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Data source&lt;/td&gt;
              &lt;td&gt;Defines the target data source. You can select a Pyroscope [profiling] data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;Defines the tags to use in the profile query. Default: &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;pod&lt;/code&gt;, &lt;code&gt;service.name&lt;/code&gt;, &lt;code&gt;service.namespace&lt;/code&gt;. You can change the tag name for example to remove dots from the name if they&amp;rsquo;re not allowed in the target data source. For example, map &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Profile type&lt;/td&gt;
              &lt;td&gt;Defines the profile type that used in the query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Use custom query&lt;/td&gt;
              &lt;td&gt;Toggles use of custom query with interpolation.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Query&lt;/td&gt;
              &lt;td&gt;Input to write custom query. Use variable interpolation to customize it with variables from span.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;
  &lt;/div&gt;

        
&lt;h2 id=&#34;custom-query-variables&#34;&gt;Custom query variables&lt;/h2&gt;
&lt;p&gt;To use a variable in your trace to logs, metrics, or profiles, you need to wrap it in &lt;code&gt;${}&lt;/code&gt;.
For example, &lt;code&gt;${__span.name}&lt;/code&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&gt;Variable name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;This variable uses the tag mapping from the UI to create a label matcher string in the specific data source syntax. The variable only uses tags that are present in the span. The link is still created even if only one of those tags is present in the span. You can use this if all tags are not required for the query to be useful.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__span.spanId&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The ID of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__span.traceId&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The ID of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__span.duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The duration of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__span.name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Name of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__span.tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Namespace for the tags in the span. To access a specific tag named &lt;code&gt;version&lt;/code&gt;, you would use &lt;code&gt;${__span.tags.version}&lt;/code&gt;. In case the tag contains dot, you have to access it as &lt;code&gt;${__span.tags[&amp;quot;http.status&amp;quot;]}&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__trace.traceId&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The ID of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__trace.duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The duration of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;__trace.name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The name of the trace.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;additional-settings&#34;&gt;Additional settings&lt;/h2&gt;
&lt;p&gt;Use the down arrow to expand the &lt;strong&gt;Additional settings&lt;/strong&gt; section to view these options.&lt;/p&gt;
&lt;h3 id=&#34;advanced-http-settings&#34;&gt;Advanced HTTP settings&lt;/h3&gt;
&lt;p&gt;The Grafana Proxy deletes forwarded cookies. Use the &lt;strong&gt;Allowed cookies&lt;/strong&gt; field to specify cookies by name that should be forwarded to the data source.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Timeout&lt;/strong&gt; field sets the HTTP request timeout in seconds.&lt;/p&gt;
&lt;h3 id=&#34;service-graph&#34;&gt;Service graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Service graph&lt;/strong&gt; setting configures the &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service_graphs/enable-service-graphs/&#34;&gt;Service Graph&lt;/a&gt; data.&lt;/p&gt;
&lt;p&gt;Configure the &lt;strong&gt;Data source&lt;/strong&gt; setting to define in which Prometheus instance the Service Graph data is stored.&lt;/p&gt;
&lt;p&gt;To use the Service Graph, refer to the &lt;a href=&#34;#use-the-service-graph&#34;&gt;Service Graph documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;node-graph&#34;&gt;Node graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Node graph&lt;/strong&gt; setting enables the 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/node-graph/&#34;&gt;node graph visualization&lt;/a&gt;, which isn&amp;rsquo;t activated by default.&lt;/p&gt;
&lt;p&gt;Once activated, Grafana displays the node graph above the trace view.&lt;/p&gt;
&lt;h3 id=&#34;tempo-search&#34;&gt;Tempo search&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Search&lt;/strong&gt; setting configures &lt;a href=&#34;/docs/tempo/latest/configuration/#search&#34;&gt;Tempo search&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can configure the &lt;strong&gt;Hide search&lt;/strong&gt; setting to hide the search query option in &lt;strong&gt;Explore&lt;/strong&gt; if search is not configured in the Tempo instance.&lt;/p&gt;
&lt;h3 id=&#34;traceid-query&#34;&gt;TraceID query&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;TraceID query&lt;/strong&gt; setting modifies how TraceID queries are run.
The time range can be used when there are performance issues or timeouts since it narrows down the search to the defined range.
This setting is disabled by default.&lt;/p&gt;
&lt;p&gt;You can configure this setting as follows:&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&gt;Name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Enable time range&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Use a time range in the TraceID query. Default: &lt;code&gt;disabled&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Time shift start&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Time shift for start of search. Default: &lt;code&gt;30m&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Time shift end&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Time shift for end of search. Default: &lt;code&gt;30m&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;tags-time-range&#34;&gt;Tags time range&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Tags time range&lt;/strong&gt; feature controls how tag and tag-value queries are executed by specifying the time window applied to these requests. You can select one of the following options to constrain your queries:&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&gt;Name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Last 30 minutes&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Last 30 minutes of selected range.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Last 3 hours&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Last 3 hours of selected range.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Last 24 hours&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Last 24 hours of selected range.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Last 3 days&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Last 3 days of selected range.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Last 7 days&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Last 7 days of selected range.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;tag-limit&#34;&gt;Tag limit&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Tag limit&lt;/strong&gt; setting modifies the max number of tags and tag values to retrieve from Tempo. Default: 5000&lt;/p&gt;
&lt;h3 id=&#34;span-bar&#34;&gt;Span bar&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Span bar&lt;/strong&gt; setting helps you display additional information in the span bar row.&lt;/p&gt;
&lt;p&gt;You can choose one of three options:&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&gt;Name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;None&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds nothing to the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Default)&lt;/em&gt; Displays the span duration on the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as &lt;code&gt;component&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;private-data-source-connect&#34;&gt;Private data source connect&lt;/h3&gt;


&lt;div data-shared=&#34;datasources/datasouce-private-ds-connect.md&#34;&gt;
            

&lt;!-- Procedure for using private data source connect section in the data sources --&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;This feature is only available in Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Use private data source connect (PDC) to connect to and query data within a secure network without opening that network to inbound traffic from Grafana Cloud.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/&#34;&gt;Private data source connect&lt;/a&gt; for more information on how PDC works and &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/configure-pdc/#configure-grafana-private-data-source-connect-pdc&#34;&gt;Configure Grafana private data source connect (PDC)&lt;/a&gt; for steps on setting up a PDC connection.&lt;/p&gt;
&lt;p&gt;Use the drop-down list to select a configured private data source. If you make changes, select &lt;strong&gt;Test &amp;amp; save&lt;/strong&gt; to preserve your changes.&lt;/p&gt;
&lt;p&gt;Use &lt;strong&gt;Manage private data source connect&lt;/strong&gt; to configure and manage any private data sources you have configured.&lt;/p&gt;

  &lt;/div&gt;

        
&lt;h2 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h2&gt;
&lt;p&gt;You can define and configure the Tempo data source in YAML files as part of the Grafana provisioning system.
Provisioning is primarily used Grafana instances that don&amp;rsquo;t use Grafana Cloud.&lt;/p&gt;
&lt;p&gt;You can use version control, like git, to track and manage file changes.
Changes can be updated or rolled back as needed.&lt;/p&gt;
&lt;p&gt;For more information about provisioning and available configuration options, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&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;You can&amp;rsquo;t modify a provisioned data source using the Tempo data source settings in Grafana.
Grafana displays a message for provisioned data sources.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;example-file&#34;&gt;Example file&lt;/h3&gt;
&lt;p&gt;This example provision YAML file sets up the equivalents of the options available in the Tempo data source user interface.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: Tempo
    type: tempo
    uid: EbPG8fYoz
    url: http://localhost:3200
    access: proxy
    basicAuth: false
    jsonData:
      tracesToLogsV2:
        # Field with an internal link pointing to a logs data source in Grafana.
        # datasourceUid value must match the uid value of the logs data source.
        datasourceUid: &amp;#39;loki&amp;#39;
        spanStartTimeShift: &amp;#39;-1h&amp;#39;
        spanEndTimeShift: &amp;#39;1h&amp;#39;
        tags: [&amp;#39;job&amp;#39;, &amp;#39;instance&amp;#39;, &amp;#39;pod&amp;#39;, &amp;#39;namespace&amp;#39;]
        filterByTraceID: false
        filterBySpanID: false
        customQuery: true
        query: &amp;#39;method=&amp;#34;$${__span.tags.method}&amp;#34;&amp;#39;
      tracesToMetrics:
        datasourceUid: &amp;#39;prom&amp;#39;
        spanStartTimeShift: &amp;#39;-1h&amp;#39;
        spanEndTimeShift: &amp;#39;1h&amp;#39;
        tags: [{ key: &amp;#39;service.name&amp;#39;, value: &amp;#39;service&amp;#39; }, { key: &amp;#39;job&amp;#39; }]
        queries:
          - name: &amp;#39;Sample query&amp;#39;
            query: &amp;#39;sum(rate(traces_spanmetrics_latency_bucket{$$__tags}[5m]))&amp;#39;
      tracesToProfiles:
        datasourceUid: &amp;#39;grafana-pyroscope-datasource&amp;#39;
        tags: [&amp;#39;job&amp;#39;, &amp;#39;instance&amp;#39;, &amp;#39;pod&amp;#39;, &amp;#39;namespace&amp;#39;]
        profileTypeId: &amp;#39;process_cpu:cpu:nanoseconds:cpu:nanoseconds&amp;#39;
        customQuery: true
        query: &amp;#39;method=&amp;#34;$${__span.tags.method}&amp;#34;&amp;#39;
      serviceMap:
        datasourceUid: &amp;#39;prometheus&amp;#39;
      nodeGraph:
        enabled: true
      search:
        hide: false
      traceQuery:
        timeShiftEnabled: true
        spanStartTimeShift: &amp;#39;-1h&amp;#39;
        spanEndTimeShift: &amp;#39;1h&amp;#39;
      spanBar:
        type: &amp;#39;Tag&amp;#39;
        tag: &amp;#39;http.path&amp;#39;
      streamingEnabled:
        search: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;Clone a provisioned data source for Grafana Cloud&lt;/h3&gt;
&lt;p&gt;If you have a data source that is provisioned by a configuration file in Grafana Cloud, you can clone that provisioned data source and then edit the new data source in the Grafana UI.&lt;/p&gt;
&lt;p&gt;For example, let&amp;rsquo;s say you want to edit the &lt;strong&gt;Trace to log&lt;/strong&gt;s settings in your Tempo data source that is provisioned on Grafana Cloud.
You&amp;rsquo;d like to enable traceID and spanID but you can&amp;rsquo;t because the data source is provisioned.
By cloning the data source, you&amp;rsquo;d be able to edit these capabilities.&lt;/p&gt;
&lt;p&gt;To clone a provisioned data source, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a viewer &lt;a href=&#34;/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/&#34;&gt;Cloud Access Policy token&lt;/a&gt; in the Grafana Cloud Portal, making sure it has read permissions at least for the data types you are trying to clone.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#add-a-new-data-source&#34;&gt;Create a new data source&lt;/a&gt; of the same type you want to clone.&lt;/li&gt;
&lt;li&gt;Copy all of the settings from the existing provisioned data source into the new data source while replacing the password with the API key you created.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The easiest way to do this is to open separate browser windows with the provisioned data source in one and the newly created data source in another.&lt;/p&gt;
&lt;p&gt;Of course, after copying the HTTP and Auth section details, pasting the Cloud Access Policy token into the Password field, and changing any of the other options that you want, you can save and test the data source.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-a-tempo-data-source">Configure a Tempo data source&lt;/h1>
&lt;p>The Tempo data source sets how Grafana connects to your Tempo database and lets you configure features and integrations with other telemetry signals.&lt;/p></description></item><item><title>Best practices for tracing</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/tracing-best-practices/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/tracing-best-practices/</guid><content><![CDATA[&lt;h1 id=&#34;best-practices-for-tracing&#34;&gt;Best practices for tracing&lt;/h1&gt;
&lt;p&gt;This page provides some general best practices for tracing.&lt;/p&gt;


&lt;div data-shared=&#34;best-practices-traces.md&#34;&gt;
            &lt;h2 id=&#34;span-and-resource-attributes&#34;&gt;Span and resource attributes&lt;/h2&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/tempo/v2.7.x/introduction/&#34;&gt;Traces&lt;/a&gt; are built from spans, which denote units of work such as a call to, or from, an upstream service. Spans are constructed primarily of span and resource attributes.
Spans also have a hierarchy, where parent spans can have children or siblings.&lt;/p&gt;
&lt;p&gt;In the screenshot below, the left side of the screen (1) shows the list of results for the query. The right side (2) lists each span that makes up the selected trace.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/tempo/screenshot-trace-explore-spans-g10.png&#34;
  alt=&#34;Traces example with query results and spans&#34; width=&#34;1474&#34;
     height=&#34;788&#34;/&gt;&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;span attribute&lt;/strong&gt; is a key/value pair that provides context for its span. For example, if the span deals with calling another service via HTTP, an attribute could include the HTTP URL (maybe as the span attribute key &lt;code&gt;http.url&lt;/code&gt;) and the HTTP status code returned (as the span attribute &lt;code&gt;http.status_code&lt;/code&gt;). Span attributes can consist of varying, non-null types.&lt;/p&gt;
&lt;p&gt;Unlike a span attribute, a &lt;strong&gt;resource attribute&lt;/strong&gt; is a key/value pair that describes the context of how the span was collected. Generally, these attributes describe the process that created the span.
This could be a set of resource attributes concerning a Kubernetes cluster, in which case you may see resource attributes, for example: &lt;code&gt;k8s.namespace&lt;/code&gt;, &lt;code&gt;k8s.container_name&lt;/code&gt;, and &lt;code&gt;k8s.cluster&lt;/code&gt;.
These can also include information on the libraries that were used to instrument the spans for a trace, or any other infrastructure information.&lt;/p&gt;
&lt;p&gt;For more information, read the &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/overview/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Attribute and Resource&lt;/a&gt; sections in the OpenTelemetry specification.&lt;/p&gt;
&lt;h3 id=&#34;naming-conventions-for-span-and-resource-attributes&#34;&gt;Naming conventions for span and resource attributes&lt;/h3&gt;
&lt;p&gt;The OpenTelemetry project defines a number of semantic conventions for attributes, which can help you to determine which attributes are most important to include in your spans. These conventions provide a common vocabulary for describing different types of entities, which can help to ensure that your data is consistent and meaningful.&lt;/p&gt;
&lt;p&gt;When naming attributes, use consistent, nested namespaces to ensures that attribute keys are obvious to anyone observing the spans of a trace and that common attributes can be shared by spans.
Using our example from above, the &lt;code&gt;http&lt;/code&gt; prefix of the attribute is the namespace, and &lt;code&gt;url&lt;/code&gt; and &lt;code&gt;status_code&lt;/code&gt; are keys within that namespace.
Attributes can also be nested, for example &lt;code&gt;http.url.protocol&lt;/code&gt; might be &lt;code&gt;HTTP&lt;/code&gt; or &lt;code&gt;HTTPS&lt;/code&gt;, whereas &lt;code&gt;http.url.path&lt;/code&gt; might be &lt;code&gt;/api/v1/query&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For more details around semantic naming conventions, refer to the &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/common/attribute-naming/#recommendations-for-opentelemetry-authors&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Recommendations for OpenTelemetry Authors&lt;/a&gt; and &lt;a href=&#34;https://github.com/open-telemetry/semantic-conventions/blob/main/docs/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Semantic Conventions&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;Some third-party libraries provide auto-instrumentation that generate span and span attributes when included in a source base.&lt;/p&gt;
&lt;p&gt;For more information about instrumenting your app for tracing, refer to the &lt;a href=&#34;/docs/tempo/latest/getting-started/instrumentation/&#34;&gt;Instrument for distributed tracing&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h3 id=&#34;how-many-attributes-should-spans-have&#34;&gt;How many attributes should spans have?&lt;/h3&gt;
&lt;p&gt;The decision of how many attributes to include in your spans is up to you. There is no hard and fast rule.
Keep the number of attributes to a minimum, as each attribute adds overhead to the tracing system.
In Grafana Cloud, this results in higher tracing costs.&lt;/p&gt;
&lt;p&gt;Only include attributes that are relevant to the operation that the span represents. For example, if you are tracing an HTTP request, you might include attributes such as the request method, the URL, and the response status code.&lt;/p&gt;
&lt;p&gt;If you are unsure whether or not to include an attribute, it is always better to err on the side of caution and leave it out. You can always add additional attributes later if you need them.&lt;/p&gt;
&lt;p&gt;In general, consider the following guidelines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t include metrics or logs as attributes in your spans.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t use redundant attributes.&lt;/li&gt;
&lt;li&gt;When determining which attributes to add, consider an application&amp;rsquo;s service flow, and execution in the context of only the current span.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The OpenTelemetry project doesn&amp;rsquo;t specify a maximum number of attributes that a span can have.
However, the default limits for the number of attributes per span is &lt;a href=&#34;https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#attribute-limits&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;128 entries&lt;/a&gt;, so you will have to adjust that. There are also default limits on attribute value and name character lengths.&lt;/p&gt;
&lt;h2 id=&#34;determining-where-to-add-spans&#34;&gt;Determining where to add spans&lt;/h2&gt;
&lt;p&gt;When instrumenting, determine the smallest piece of work that you need to observe in a trace to be of value to ensure that you don’t over (or under) instrument.&lt;/p&gt;
&lt;p&gt;Creating a new span for any work that has a relatively significant duration allows the observation of a trace to immediately show where significant amounts of time are spent during the processing of a request into your application or system.&lt;/p&gt;
&lt;p&gt;For example, adding a span for a call to another services (either instrumented or not) may take an unknown amount of time to complete, and therefore being able to separate this work shows when services are taking longer than expected.&lt;/p&gt;
&lt;p&gt;Adding a span for a piece of work that might call many other functions in a loop is a good signal of how long that loop is taking (you might add a span attribute that counts how many time the loop runs to determine if the duration is acceptable).
However, adding a span for each method or function call in that loop might not, as it might produce hundreds or thousands of worthless spans.&lt;/p&gt;
&lt;h2 id=&#34;span-length&#34;&gt;Span length&lt;/h2&gt;
&lt;p&gt;While there are some (high) default limits to the length that a span (and by definition, the traces they belong to) can be, these can be adjusted by 
    &lt;a href=&#34;/docs/tempo/v2.7.x/configuration/#ingestion-limits&#34;&gt;these configurations&lt;/a&gt;.
Traces that include a large number of spans and/or long-running spans can have an impact on the time taken to query them once stored.
Cloud Traces users should contact Grafana Support to modify overrides.&lt;/p&gt;
&lt;p&gt;For long-running spans and traces, the best way to see this impact on requests is to send a few test cases and see what the performance looks like and to evaluate the trace size.&lt;/p&gt;
&lt;p&gt;From there, you can modify the configuration for Tempo or determine ways to re-architect how the trace is produced.&lt;/p&gt;
&lt;p&gt;You can consider breaking up the spans in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decompose the query
&lt;ul&gt;
&lt;li&gt;For example, if a complex SQL query involves multiple operations (for example, uses joins, subqueries, or unions), consider creating separate spans for each significant operation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Improve granulation of long-running spans
&lt;ul&gt;
&lt;li&gt;For long-running operations, you could create a new span for every predetermined interval of execution time.


&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;This requires time-based tracking in your application&amp;rsquo;s code and is more complex to implement.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use span linking
&lt;ul&gt;
&lt;li&gt;Should data flow hit bottlenecks where further operations on that data might be batched at a later time, the use of &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/overview.md#links-between-spans&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;span links&lt;/a&gt; can help keep traces constrained to an acceptable time range, while sharing context with other traces that work on the same data. This can also improve the readability of traces.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="best-practices-for-tracing">Best practices for tracing&lt;/h1>
&lt;p>This page provides some general best practices for tracing.&lt;/p>
&lt;div data-shared="best-practices-traces.md">
&lt;h2 id="span-and-resource-attributes">Span and resource attributes&lt;/h2>
&lt;p>
&lt;a href="/docs/tempo/v2.7.x/introduction/">Traces&lt;/a> are built from spans, which denote units of work such as a call to, or from, an upstream service. Spans are constructed primarily of span and resource attributes.
Spans also have a hierarchy, where parent spans can have children or siblings.&lt;/p></description></item><item><title>Use traces in Grafana</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/traces-in-grafana/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/traces-in-grafana/</guid><content><![CDATA[&lt;h1 id=&#34;use-traces-in-grafana&#34;&gt;Use traces in Grafana&lt;/h1&gt;
&lt;p&gt;Using traces, you can search for traces, generate metrics from spans, and link your tracing data with logs, metrics, and profiles.&lt;/p&gt;
&lt;p&gt;This page provides a summary of how you can use tracing data in Grafana.&lt;/p&gt;
&lt;p&gt;For general documentation on querying data sources in Grafana, refer to &lt;a href=&#34;/docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;


&lt;div data-shared=&#34;tempo-in-grafana.md&#34;&gt;
            &lt;!--  Use traces in Grafana --&gt;
&lt;h2 id=&#34;query-your-data&#34;&gt;Query your data&lt;/h2&gt;
&lt;p&gt;Using tracing data in Grafana and Grafana Cloud Traces, you can search for traces, generate metrics from spans, and link your tracing data with logs, metrics, and profiles.&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;Trace results for matching spans are returned on a first-match basis. These results may not be the latest traces stored by Tempo.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;use-traces-drilldown-to-investigate-tracing-data&#34;&gt;Use Traces Drilldown to investigate tracing data&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown&lt;/a&gt; helps you visualize insights from your Tempo traces data.
Using the app, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;em&gt;Rate&lt;/em&gt;, &lt;em&gt;Errors&lt;/em&gt;, and &lt;em&gt;Duration&lt;/em&gt; (RED) metrics derived from traces to investigate issues&lt;/li&gt;
&lt;li&gt;Uncover related issues and monitor changes over time&lt;/li&gt;
&lt;li&gt;Browse automatic visualizations of your data based on its characteristics&lt;/li&gt;
&lt;li&gt;Do all of this without writing TraceQL queries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Expand your observability journey and learn about &lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/&#34;&gt;the Drilldown apps suite&lt;/a&gt;.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/a3uB1C2oHA4&#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;h3 id=&#34;search-for-traces&#34;&gt;Search for traces&lt;/h3&gt;
&lt;p&gt;Search for traces using common dimensions such as time range, duration, span tags, service names, etc.
Use the Explore trace view to quickly diagnose errors and high latency events in your system.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_search.png&#34;
  alt=&#34;Sample search visualization&#34; width=&#34;1794&#34;
     height=&#34;816&#34;/&gt;&lt;/p&gt;
&lt;h3 id=&#34;search-is-non-deterministic&#34;&gt;Search is non-deterministic&lt;/h3&gt;
&lt;p&gt;Most search functions are deterministic.
When given the same criteria, a deterministic algorithm returns consistent results.
For example, let&amp;rsquo;s say that you query a search engine for the definition of &amp;ldquo;traces.&amp;rdquo;
The results list the same top matches for each query for &amp;ldquo;traces&amp;rdquo; in that search engine.&lt;/p&gt;
&lt;p&gt;However, Tempo search is non-deterministic.
If you perform the same search twice, you’ll get different lists, assuming the possible number of results for your search is greater than the number of results you have your search set to return.&lt;/p&gt;
&lt;p&gt;When performing a search, Tempo does a massively parallel search over the given time range, and takes the first &lt;code&gt;N&lt;/code&gt; results.
Even identical searches differ due to things like machine load and network latency.
This approach values speed over predictability and is quite simple; enforcing that the search results are consistent would introduce additional complexity (and increase the time the user spends waiting for results).
TraceQL follows the same behavior.&lt;/p&gt;
&lt;p&gt;By adding &lt;code&gt;most_recent=true&lt;/code&gt; to your TraceQL queries, the search results become deterministic.
For more information, refer to 
    &lt;a href=&#34;/docs/tempo/latest/traceql/#retrieving-most-recent-results-experimental&#34;&gt;Retrieve most recent results&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;use-trace-search-results-as-panels-in-dashboards&#34;&gt;Use trace search results as panels in dashboards&lt;/h4&gt;
&lt;p&gt;You can embed tracing panels and visualizations in dashboards.
You can also save queries as panels.
For more information, refer to the &lt;a href=&#34;/docs/grafana-cloud/visualizations/panels-visualizations/visualizations/traces/#add-traceql-with-table-visualizations&#34;&gt;Traces Visualization&lt;/a&gt; documentation.&lt;/p&gt;
&lt;p&gt;For example dashboards, visit &lt;a href=&#34;https://play.grafana.org&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;play.grafana.org&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/d/fab5705a-e213-4527-8c23-92cb7452e746/traces-and-basic-operations-on-them?orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Traces and basic operations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.grafana.org/explore?schemaVersion=1&amp;amp;panes=%7B%22cf2%22:%7B%22datasource%22:%22grafanacloud-traces%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22tempo%22,%22uid%22:%22grafanacloud-traces%22%7D,%22queryType%22:%22traceqlSearch%22,%22limit%22:20,%22tableType%22:%22traces%22,%22filters%22:%5B%7B%22id%22:%22ab3bc4be%22,%22operator%22:%22%3D%22,%22scope%22:%22span%22%7D%5D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D%7D&amp;amp;orgId=1&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Explore with a Tempo data source&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;use-traceql-to-query-data-and-generate-metrics&#34;&gt;Use TraceQL to query data and generate metrics&lt;/h3&gt;
&lt;p&gt;Inspired by PromQL and LogQL, TraceQL is a query language designed for selecting traces.&lt;/p&gt;
&lt;p&gt;Using Grafana &lt;strong&gt;Explore&lt;/strong&gt;, you can search traces.
The default traces search reviews the whole trace.
TraceQL provides a method for formulating precise queries so you can zoom in to the data you need.
Query results return faster because the queries limit what is searched.&lt;/p&gt;
&lt;p&gt;You can construct queries using the 
    &lt;a href=&#34;/docs/grafana/v11.0/datasources/tempo/query-editor/traceql-editor/&#34;&gt;TraceQL query editor&lt;/a&gt; or use the 
    &lt;a href=&#34;/docs/grafana/v11.0/datasources/tempo/query-editor/traceql-search/&#34;&gt;Search query type&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For details about constructing queries, refer to the 
    &lt;a href=&#34;/docs/tempo/latest/traceql/&#34;&gt;TraceQL documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;traceql-metrics-queries&#34;&gt;TraceQL metrics queries&lt;/h4&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;TraceQL metrics is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental feature&lt;/a&gt;. Engineering and on-call support is not available. Documentation is either limited or not provided outside of code comments. No SLA is provided. Enable the  feature toggle in Grafana to use this feature. Do not enable this feature in production environments.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;


&lt;p&gt;TraceQL language provides metrics queries as an experimental feature.
Metric queries extend trace queries by applying an aggregate function to trace query results. For example: &lt;code&gt;{ span:name = &amp;quot;foo&amp;quot; } | rate() by (span:status)&lt;/code&gt;
This powerful feature creates metrics from traces, much in the same way that LogQL metric queries create metrics from logs.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana-cloud/visualizations/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown&lt;/a&gt; is powered by metrics queries.&lt;/p&gt;
&lt;p&gt;For more information about available queries, refer to 
    &lt;a href=&#34;/docs/tempo/latest/traceql/metrics-queries/&#34;&gt;TraceQL metrics queries&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;generate-metrics-from-spans&#34;&gt;Generate metrics from spans&lt;/h3&gt;
&lt;p&gt;RED metrics can drive service graphs and other ready-to-go visualizations of your span data.
RED metrics represent:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Rate&lt;/em&gt;, the number of requests per second&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Errors&lt;/em&gt;, the number of those requests that are failing&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Duration&lt;/em&gt;, the amount of time those requests take&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about RED method, refer to &lt;a href=&#34;/blog/2018/08/02/the-red-method-how-to-instrument-your-services/&#34;&gt;The RED Method: how to instrument your services&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To enable metrics-generator in Grafana Cloud, refer to &lt;a href=&#34;/docs/grafana-cloud/send-data/traces/metrics-generator/&#34;&gt;Enable metrics-generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To enable metrics-generator for Tempo, refer to 
    &lt;a href=&#34;/docs/tempo/latest/configuration/#metrics-generator&#34;&gt;Configure metrics-generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_service_graph.png&#34;
  alt=&#34;Service graph view&#34; width=&#34;1597&#34;
     height=&#34;895&#34;/&gt;&lt;/p&gt;
&lt;p&gt;These metrics exist in your Hosted Metrics instance and can also be easily used to generate powerful custom dashboards.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_custom_metrics_dash.png&#34;
  alt=&#34;Custom Metrics Dashboard&#34; width=&#34;1611&#34;
     height=&#34;776&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Metrics automatically generate exemplars as well which allows easy metrics to trace linking.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_exemplars.png&#34;
  alt=&#34;Trace Exemplars&#34; width=&#34;1843&#34;
     height=&#34;781&#34;/&gt;&lt;/p&gt;
&lt;h4 id=&#34;service-graph-view&#34;&gt;Service graph view&lt;/h4&gt;
&lt;p&gt;Service graph view displays a table of request rate, error rate, and duration metrics (RED) calculated from your incoming spans.
It also includes a node graph view built from your spans.&lt;/p&gt;
&lt;p&gt;To use the service graph view, you need to enable 
    &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service_graphs/&#34;&gt;service graphs&lt;/a&gt; and 
    &lt;a href=&#34;/docs/tempo/latest/metrics-generator/span_metrics/&#34;&gt;span metrics&lt;/a&gt;.
After it&amp;rsquo;s enabled, this pre-configured view is immediately available in &lt;strong&gt;Explore &amp;gt; Service Graphs&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Refer to the 
    &lt;a href=&#34;https://docs/tempo/latest/metrics-generator/service-graph-view&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;service graph view documentation&lt;/a&gt; for further information.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/apm-overview.png&#34;
  alt=&#34;Service graph view overview&#34; width=&#34;1266&#34;
     height=&#34;915&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;integrate-other-telemetry-signals&#34;&gt;Integrate other telemetry signals&lt;/h2&gt;
&lt;h3 id=&#34;link-traces-and-logs&#34;&gt;Link traces and logs&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re already doing request/response logging with trace IDs, they can be easily extracted from logs to jump directly to your traces.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_sample.png&#34;
  alt=&#34;Logs to Traces visualization&#34; width=&#34;1606&#34;
     height=&#34;889&#34;/&gt;&lt;/p&gt;
&lt;p&gt;In the other direction, you can configure Grafana and Grafana Cloud to create a link from an individual span to your Loki logs.
If you see a long-running span or a span with errors, you
can immediately jump to the logs of the process causing the error.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/grafana-cloud/trace_to_logs.png&#34;
  alt=&#34;Traces to Logs visualization&#34; width=&#34;1584&#34;
     height=&#34;883&#34;/&gt;&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;Cloud Traces only supports custom tags added by Grafana Support.
Cloud Traces supports these default tags: &lt;code&gt;cluster&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, and &lt;code&gt;pod&lt;/code&gt;.
Contact Support to add a custom tag.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;link-traces-and-metrics&#34;&gt;Link traces and metrics&lt;/h3&gt;
&lt;p&gt;Grafana can correlate different signals by adding the functionality to link between traces and metrics. &lt;a href=&#34;/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/&#34;&gt;Trace to metrics&lt;/a&gt; lets you navigate from a trace span to a selected data source.
Using trace to metrics, you can quickly see trends or aggregated data related to each span.&lt;/p&gt;
&lt;p&gt;For example, you can use span attributes to metric labels by using the &lt;code&gt;$__tags&lt;/code&gt; keyword to convert span attributes to metrics labels.&lt;/p&gt;
&lt;p&gt;To set up Trace to metrics for your data source, refer to &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/configure-tempo-data-source/#trace-to-metrics&#34;&gt;Trace to metric configuration&lt;/a&gt;.&lt;/p&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;h3 id=&#34;link-traces-and-profiles&#34;&gt;Link traces and profiles&lt;/h3&gt;
&lt;p&gt;Using Trace to profiles, you can correlate different signals by adding the functionality to link between traces and profiles.&lt;/p&gt;
&lt;p&gt;Trace to profiles lets you link your 
    &lt;a href=&#34;/docs/pyroscope/latest/&#34;&gt;Grafana Pyroscope&lt;/a&gt; data source to tracing data in Grafana or Grafana Cloud.
When configured, this connection lets you run queries from a trace span into the profile data.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/tempo/profiles/tempo-profiles-Span-link-profile-data-source.png&#34;
  alt=&#34;Selecting a link in the span queries the profile data source&#34; width=&#34;1681&#34;
     height=&#34;1102&#34;/&gt;&lt;/p&gt;
&lt;p&gt;For more information, refer to the 
    &lt;a href=&#34;/docs/grafana/v11.0/datasources/tempo/configure-tempo-data-source/#trace-to-profiles&#34;&gt;Traces to profiles documentation&lt;/a&gt; and the 
    &lt;a href=&#34;https://docs/grafana/v11.0/datasources/grafana-pyroscope/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Pyroscope data source documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For Cloud Traces, Refer to the &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/configure-tempo-data-source/#trace-to-profiles&#34;&gt;Traces to profiles documentation&lt;/a&gt; for configuration instructions.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/AG8VzfFMLxo&#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;/div&gt;

        
]]></content><description>&lt;h1 id="use-traces-in-grafana">Use traces in Grafana&lt;/h1>
&lt;p>Using traces, you can search for traces, generate metrics from spans, and link your tracing data with logs, metrics, and profiles.&lt;/p></description></item><item><title>Query tracing data</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;query-tracing-data&#34;&gt;Query tracing data&lt;/h1&gt;
&lt;p&gt;The Tempo data source&amp;rsquo;s query editor helps you query and display traces from Tempo in 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore&lt;/a&gt;.
The queries use &lt;a href=&#34;/docs/tempo/latest/traceql/&#34;&gt;TraceQL&lt;/a&gt;, the query language designed specifically for tracing.&lt;/p&gt;
&lt;p&gt;For general documentation on querying data sources in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-tip&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Tip&lt;/p&gt;&lt;p&gt;Don&amp;rsquo;t know TraceQL? Try 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/simplified-exploration/traces/&#34;&gt;Grafana Traces Drilldown&lt;/a&gt;, an intuitive, queryless app that lets you explore your tracing data using RED metrics.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;You can compose TraceQL queries in Grafana and Grafana Cloud using &lt;strong&gt;Explore&lt;/strong&gt; and a Tempo data source.&lt;/p&gt;
&lt;h3 id=&#34;traceql-knowledge-helpful-but-not-required&#34;&gt;TraceQL knowledge helpful, but not required&lt;/h3&gt;
&lt;p&gt;You don&amp;rsquo;t have to know TraceQL to create a query.
You can use the &lt;strong&gt;Search&lt;/strong&gt; query builder&amp;rsquo;s user interface to select options to search your data.
These selections generate a TraceQL query.
Any query generated using &lt;strong&gt;Search&lt;/strong&gt; query builder can be transferred to the &lt;strong&gt;TraceQL&lt;/strong&gt; query editor, where you can edit the query directly.&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;h2 id=&#34;choose-a-query-editing-mode&#34;&gt;Choose a query editing mode&lt;/h2&gt;
&lt;p&gt;The query editor has three &lt;strong&gt;Query types&lt;/strong&gt; that you can use to explore your tracing data.
You can use these modes by themselves or in combination to create building blocks to generate custom queries.
Adding another query adds a new query block.
Refer to &lt;a href=&#34;#use-query-types-together&#34;&gt;Use query types together&lt;/a&gt; for more information.&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-types.png&#34;
  alt=&#34;The three query types: Search, TraceQL, and Service Graph&#34; width=&#34;807&#34;
     height=&#34;86&#34;/&gt;&lt;/p&gt;
&lt;p&gt;The three query types are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; query builder - Provides a user interface for building a TraceQL query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TraceQL&lt;/strong&gt; query editor - Lets you write your own TraceQL query with assistance from autocomplete.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service Graph&lt;/strong&gt; view - Displays a visual relationship between services. Refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/service-graph/&#34;&gt;Service graph&lt;/a&gt; documentation for more information.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;search-query-builder&#34;&gt;Search query builder&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Search&lt;/strong&gt; query builder provides drop-down lists and text fields to help you write a query.
The query builder is ideal for people who aren&amp;rsquo;t familiar with or want to learn TraceQL.&lt;/p&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;traceql-search/&#34;&gt;Search using the TraceQL query builder documentation&lt;/a&gt; to learn more about creating queries using convenient drop-down menus.&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;h3 id=&#34;traceql-query-editor&#34;&gt;TraceQL query editor&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;TraceQL&lt;/strong&gt; query editor lets you search by trace ID and write TraceQL queries using autocomplete.&lt;/p&gt;
&lt;p&gt;Refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/query-editor/traceql-editor/&#34;&gt;TraceQL query editor documentation&lt;/a&gt; to learn more about constructing queries using a code-editor-like experience.&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;p&gt;You can also search for a trace ID by entering it into the query field.&lt;/p&gt;
&lt;h3 id=&#34;service-graph-view&#34;&gt;Service graph view&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Service Graph&lt;/strong&gt; view uses metrics to display span request rates, error rates, and durations, as well as service graphs.
After the requirements are set up, this preconfigured view is immediately available.&lt;/p&gt;
&lt;p&gt;Using the service graph view, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Discover spans which are consistently erroring and the rates at which they occur.&lt;/li&gt;
&lt;li&gt;Get an overview of the overall rate of span calls throughout your services.&lt;/li&gt;
&lt;li&gt;Determine how long the slowest queries in your service take to complete.&lt;/li&gt;
&lt;li&gt;Examine all traces that contain spans of particular interest based on rate, error, and duration values (RED signals).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about the service graph, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/service-graph/&#34;&gt;Service graph&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-service-graph.png&#34;
  alt=&#34;Screenshot of the Service Graph view&#34; width=&#34;1290&#34;
     height=&#34;1145&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;use-traceql-panels-in-dashboards&#34;&gt;Use TraceQL panels in dashboards&lt;/h2&gt;
&lt;p&gt;To add TraceQL panels to your dashboard, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/traces/&#34;&gt;Traces panel documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To learn more about Grafana dashboards, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/use-dashboards/&#34;&gt;Use dashboards documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;set-options-for-query-builder-and-editor&#34;&gt;Set options for query builder and editor&lt;/h2&gt;
&lt;p&gt;The following options are available for the &lt;strong&gt;Search&lt;/strong&gt; and &lt;strong&gt;TraceQL&lt;/strong&gt; query types.
You can modify these settings in the &lt;strong&gt;Options&lt;/strong&gt; section.&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-options.png&#34;
  alt=&#34;Options section in the query editors&#34; width=&#34;569&#34;
     height=&#34;117&#34;/&gt;&lt;/p&gt;
&lt;p&gt;After changing any option, re-run the query to apply the updates.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Limit&lt;/dt&gt;
&lt;dd&gt;Determines the maximum number of traces to return. Default value is &lt;code&gt;20&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;Span Limit&lt;/dt&gt;
&lt;dd&gt;Sets the maximum number of spans to return for each spanset. Default value is &lt;code&gt;3&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;Table Format&lt;/dt&gt;
&lt;dd&gt;Determines whether the query results table is displayed focused on &lt;strong&gt;Traces&lt;/strong&gt; or &lt;strong&gt;Spans&lt;/strong&gt;. &lt;strong&gt;Traces&lt;/strong&gt; is the default selection. When &lt;strong&gt;Traces&lt;/strong&gt; is selected, the results table starts with the trace ID. When &lt;strong&gt;Spans&lt;/strong&gt; is selected, the table starts with the trace service.&lt;/dd&gt;
&lt;dt&gt;Step&lt;/dt&gt;
&lt;dd&gt;Defines the step for metrics queries. Use duration notation, for example, &lt;code&gt;30ms&lt;/code&gt; or &lt;code&gt;1m&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;Streaming&lt;/dt&gt;
&lt;dd&gt;Indicates if streaming is active. Streaming lets you view partial query results before the entire query completes. Activating streaming adds the &lt;strong&gt;Table - Streaming Progress&lt;/strong&gt; section to the query results.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;use-query-types-together&#34;&gt;Use query types together&lt;/h2&gt;
&lt;p&gt;You can use &lt;strong&gt;&#43; Add query&lt;/strong&gt; to create customized queries that use one or more of the query types together.
Each time you add a new query, it adds a new section, or query block, that contains &lt;strong&gt;Search&lt;/strong&gt;, &lt;strong&gt;TraceQL&lt;/strong&gt;, or &lt;strong&gt;Service Graph&lt;/strong&gt; user interface.&lt;/p&gt;
&lt;p&gt;The added query and results table appear in the navigation under &lt;strong&gt;Queries&lt;/strong&gt; and &lt;strong&gt;Tables&lt;/strong&gt; respectively.
You can use the navigation to view query, results table, and service graph blocks.&lt;/p&gt;
&lt;div class=&#34;my-cool-video&#34;&gt;
  &lt;figure class=&#34;p-0 m-0 d-flex flex-direction-column align-items-center&#34;&gt;
    &lt;video 
      width=&#34;800px&#34; 
      controls
      muted
      playsinline
      
        class=&#34;lazyload&#34;
        preload=&#34;none&#34;
        
             
      
      
        loop
      
      src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-editor.mp4&#34;
      type=&#34;video/mp4&#34;
    &gt;
    &lt;/video&gt;&lt;figcaption class=&#34;mb-2&#34;&gt;Navigating through the query blocks&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;To add a query block:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;&#43; Add query&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose a query type: &lt;strong&gt;Search&lt;/strong&gt;, &lt;strong&gt;TraceQL&lt;/strong&gt;, or &lt;strong&gt;Service Graph&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To remove a query block, select the &lt;strong&gt;Remove query&lt;/strong&gt; trash can icon.&lt;/p&gt;
&lt;p&gt;To rename a block, select the &lt;strong&gt;Rename&lt;/strong&gt; edit icon next to the query block name.
The name changes in the queries and table list.&lt;/p&gt;
&lt;h3 id=&#34;additional-query-block-options&#34;&gt;Additional query block options&lt;/h3&gt;
&lt;p&gt;Each query block has a set of icons in the right top corner.&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-additional-options-toolbar.png&#34;
  alt=&#34;The additional options toolbar&#34; width=&#34;1007&#34;
     height=&#34;277&#34;/&gt;&lt;/p&gt;
&lt;p&gt;These icons include:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Show data source help&lt;/dt&gt;
&lt;dd&gt;Displays the &lt;strong&gt;Tempo Cheat Sheet&lt;/strong&gt; with links to documentation.&lt;/dd&gt;
&lt;dt&gt;Create recorded query&lt;/dt&gt;
&lt;dd&gt;Lets you save the current query block as a recorded query. This option is available in Grafana Cloud and Grafana Enterprise. For more information, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/recorded-queries/&#34;&gt;Recorded queries&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;Duplicate query&lt;/dt&gt;
&lt;dd&gt;Copies the current block and adds a new identical block.&lt;/dd&gt;
&lt;dt&gt;Remove query&lt;/dt&gt;
&lt;dd&gt;Deletes the query block.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id=&#34;use-query-history-and-query-inspector&#34;&gt;Use query history and query inspector&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Explore&lt;/strong&gt; provides a history of all queries you&amp;rsquo;ve used within a data source and an inspector that lets you view stats, inspect queries, view JSON, and general information for your data source queries.&lt;/p&gt;
&lt;p&gt;For more information, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/explore-inspector/&#34;&gt;Query inspector in Explore&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/query-management/&#34;&gt;Query management in Explore&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;cross-tenant-traceql-queries&#34;&gt;Cross-tenant TraceQL queries&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;ve configured a multi-stack Tempo data source, you can perform TraceQL queries across those stacks and tenants.&lt;/p&gt;
&lt;p&gt;Queries performed using the cross-tenant configured data source, in either &lt;strong&gt;Explore&lt;/strong&gt; or inside of dashboards,
are performed across all the tenants that you specified in the &lt;strong&gt;X-Scope-OrgID&lt;/strong&gt; header.&lt;/p&gt;
&lt;!-- vale Grafana.Spelling = NO --&gt;
&lt;p&gt;TraceQL queries that compare multiple spansets may not correctly return all traces in a cross-tenant query. For instance,&lt;/p&gt;
&lt;!-- vale Grafana.Quotes = YES --&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;{ span.attr1 = &amp;#34;bar&amp;#34; } &amp;amp;&amp;amp; { span.attr2 = &amp;#34;foo&amp;#34; }&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;TraceQL evaluates a contiguously stored trace.
If these two conditions are satisfied in separate tenants, then Tempo doesn&amp;rsquo;t return the trace.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/multi-stack-data-sources/#set-up-a-multi-stack-tempo-data-source-in-grafana&#34;&gt;Set up a multi-stack Tempo data source in Grafana&lt;/a&gt; for information about configuring the Tempo data source.&lt;/p&gt;
&lt;p&gt;For information about Tempo configuration requirements, refer to the 
    &lt;a href=&#34;/docs/tempo/latest/operations/cross_tenant_query/&#34;&gt;Cross-tenant query&lt;/a&gt; and 
    &lt;a href=&#34;/docs/tempo/latest/operations/multitenancy/&#34;&gt;Enable multitenancy&lt;/a&gt; documentation.&lt;/p&gt;
]]></content><description>&lt;h1 id="query-tracing-data">Query tracing data&lt;/h1>
&lt;p>The Tempo data source&amp;rsquo;s query editor helps you query and display traces from Tempo in
&lt;a href="/docs/grafana/v12.4/explore/">Explore&lt;/a>.
The queries use &lt;a href="/docs/tempo/latest/traceql/">TraceQL&lt;/a>, the query language designed specifically for tracing.&lt;/p></description></item><item><title>Service Graph and Service Graph view</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/service-graph/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/service-graph/</guid><content><![CDATA[&lt;h1 id=&#34;service-graph-and-service-graph-view&#34;&gt;Service Graph and Service Graph view&lt;/h1&gt;
&lt;p&gt;The Service Graph is a visual representation of the relationships between services.
Each node on the graph represents a service such as an API or database.&lt;/p&gt;
&lt;p&gt;You use the Service Graph to detect performance issues; track increases in error, fault, or throttle rates in services; and investigate root causes by viewing corresponding traces.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=320 320w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=550 550w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=750 750w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=900 900w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=1040 1040w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=1240 1240w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1333&#34;height=&#34;715&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-node-graph.png&#34;
            alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1333&#34;height=&#34;715&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;display-the-service-graph&#34;&gt;Display the Service Graph&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/tempo/latest/configuration/grafana-alloy/&#34;&gt;Configure Grafana Alloy&lt;/a&gt; or 
    &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service_graphs/#tempo&#34;&gt;Tempo or GET&lt;/a&gt; to generate Service Graph data.&lt;/li&gt;
&lt;li&gt;Link a Prometheus data source in the Tempo data source&amp;rsquo;s 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/tempo/configure-tempo-data-source/#configure-service-graph&#34;&gt;Service Graph&lt;/a&gt; settings.&lt;/li&gt;
&lt;li&gt;Navigate to 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Service Graph&lt;/strong&gt; query type.&lt;/li&gt;
&lt;li&gt;Run the query.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(Optional)&lt;/em&gt; Filter by service name.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For details, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/node-graph/&#34;&gt;Node Graph panel&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Each circle in the graph represents a service.
To open a context menu with additional links for quick navigation to other relevant information, click a service.&lt;/p&gt;
&lt;p&gt;Numbers inside the circles indicate the average time per request and requests per second.&lt;/p&gt;
&lt;p&gt;Each circle&amp;rsquo;s color represents the percentage of requests in each state:&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&gt;Color&lt;/th&gt;
              &lt;th&gt;State&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Green&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Success&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Red&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Fault&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Yellow&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Errors&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Purple&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Throttled responses&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;open-the-service-graph-view&#34;&gt;Open the Service Graph view&lt;/h2&gt;
&lt;p&gt;Service graph view displays a table of request rate, error rate, and duration metrics (RED) calculated from your incoming spans. It also includes a node graph view built from your spans.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=320 320w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=550 550w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=750 750w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=900 900w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=1040 1040w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=1240 1240w, /media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Service Graph view&#34;width=&#34;1290&#34;height=&#34;1145&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/tempo/query-editor/tempo-ds-query-service-graph.png&#34;
            alt=&#34;Screenshot of the Service Graph view&#34;width=&#34;1290&#34;height=&#34;1145&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;For details, refer to the 
    &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service-graph-view/&#34;&gt;Service Graph view documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To open the Service Graph view:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Link a Prometheus data source in the Tempo data source settings.&lt;/li&gt;
&lt;li&gt;Navigate to 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Service Graph&lt;/strong&gt; query type.&lt;/li&gt;
&lt;li&gt;Run the query.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(Optional)&lt;/em&gt; Filter your results.&lt;/li&gt;
&lt;/ol&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;Grafana uses the &lt;code&gt;traces_spanmetrics_calls_total&lt;/code&gt; metric to display the name, rate, and error rate columns, and &lt;code&gt;traces_spanmetrics_latency_bucket&lt;/code&gt; to display the duration column.
These metrics must exist in your Prometheus data source.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To open a query in Prometheus with the span name of that row automatically set in the query, click a row in the &lt;strong&gt;rate&lt;/strong&gt;, &lt;strong&gt;error rate&lt;/strong&gt;, or &lt;strong&gt;duration&lt;/strong&gt; columns.&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-service-graph-prom.png&#34;
  alt=&#34;Linked Prometheus data for Rate from within a service graph&#34; width=&#34;1396&#34;
     height=&#34;1075&#34;/&gt;&lt;/p&gt;
&lt;p&gt;To open a query in Tempo with the span name of that row automatically set in the query, click a row in the &lt;strong&gt;links&lt;/strong&gt; column.&lt;/p&gt;
]]></content><description>&lt;h1 id="service-graph-and-service-graph-view">Service Graph and Service Graph view&lt;/h1>
&lt;p>The Service Graph is a visual representation of the relationships between services.
Each node on the graph represents a service such as an API or database.&lt;/p></description></item><item><title>Span filters</title><link>https://grafana.com/docs/grafana/v12.4/datasources/tempo/span-filters/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/tempo/span-filters/</guid><content><![CDATA[&lt;h1 id=&#34;span-filters&#34;&gt;Span filters&lt;/h1&gt;
&lt;p&gt;When working with traces, especially those comprising a vast number of spans, pinpointing specific spans of interest can be a daunting task.
This is where span filtering comes in.
Located above the trace view, span filters allow you to refine the spans displayed based on specific criteria.
Whether you’re looking to identify spans from a certain service, those exceeding a particular duration, or spans tagged with specific attributes, span filtering streamlines the process.&lt;/p&gt;
&lt;p&gt;Using span filters, you can filter your spans in the trace timeline viewer. The more filters you add, the more specific are the filtered spans.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/tempo/screenshot-grafana-tempo-span-filters-v10-1.png&#34;
  alt=&#34;Screenshot of span filtering&#34; width=&#34;833&#34;
     height=&#34;239&#34;/&gt;&lt;/p&gt;
&lt;p&gt;You can add one or more of the following filters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Service name&lt;/li&gt;
&lt;li&gt;Span name&lt;/li&gt;
&lt;li&gt;Duration&lt;/li&gt;
&lt;li&gt;Tags (which include tags, process tags, and log fields)&lt;/li&gt;
&lt;/ul&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/VP2XV3IIc80&#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;use-span-filters&#34;&gt;Use span filters&lt;/h2&gt;
&lt;p&gt;You can access span filters from within the trace view. You can add one or more filters.
The more filters you add, the more specific data that you are filtering.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Expand a trace to view individual spans.&lt;/li&gt;
&lt;li&gt;Select a span to view the span details.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Span Filters&lt;/strong&gt; to display the available filters.&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-span-filters-find.gif&#34;
  alt=&#34;Locate span filters in trace view&#34; width=&#34;1384&#34;
     height=&#34;912&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Query results in the span view update as you select filters.&lt;/p&gt;
&lt;h3 id=&#34;show-matches-only&#34;&gt;Show matches only&lt;/h3&gt;
&lt;p&gt;For a more focused view, the &lt;strong&gt;Show matches only&lt;/strong&gt; toggle ensures only the spans meeting your criteria are displayed. This is particularly useful when sifting through thousands of spans, allowing you to zero in on those that truly matter.
For instance, if you’re keen on understanding why a specific request is lagging, or if you’re on the hunt for spans without a certain tag, span filtering is your go-to tool.
It even lets you search for spans based on specific tag keys, like cluster.&lt;/p&gt;
&lt;h3 id=&#34;remove-a-filter&#34;&gt;Remove a filter&lt;/h3&gt;
&lt;p&gt;To remove a filter, select the &lt;strong&gt;X&lt;/strong&gt; next to the line item.&lt;/p&gt;
]]></content><description>&lt;h1 id="span-filters">Span filters&lt;/h1>
&lt;p>When working with traces, especially those comprising a vast number of spans, pinpointing specific spans of interest can be a daunting task.
This is where span filtering comes in.
Located above the trace view, span filters allow you to refine the spans displayed based on specific criteria.
Whether you’re looking to identify spans from a certain service, those exceeding a particular duration, or spans tagged with specific attributes, span filtering streamlines the process.&lt;/p></description></item></channel></rss>