<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/v10.1/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/v10.1/datasources/tempo/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure the Tempo data source</title><link>https://grafana.com/docs/grafana/v10.1/datasources/tempo/configure-tempo-data-source/</link><pubDate>Fri, 07 Mar 2025 11:34:44 +0100</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/tempo/configure-tempo-data-source/</guid><content><![CDATA[&lt;h1 id=&#34;configure-the-tempo-data-source&#34;&gt;Configure the Tempo data source&lt;/h1&gt;
&lt;p&gt;To configure basic settings for the Tempo data source, complete the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Connections&lt;/strong&gt; in the left-side menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under Your connections, click &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;Tempo&lt;/code&gt; in the search bar.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Tempo&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;Settings&lt;/strong&gt; tab, set the data source&amp;rsquo;s basic configuration 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;Name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the name you use to refer to the data source in panels and queries.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the data source that&amp;rsquo;s pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the URL of the Tempo instance, such as &lt;code&gt;http://tempo&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables basic authentication to the Tempo data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the user name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also configure settings specific to the Tempo data source. These options are described in the sections below.&lt;/p&gt;
&lt;h2 id=&#34;trace-to-logs&#34;&gt;Trace to logs&lt;/h2&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/tempo/tempo-trace-to-logs-9-4.png&#34;
  alt=&#34;Trace to logs settings&#34; width=&#34;1219&#34;
     height=&#34;852&#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;Available in Grafana v7.4 and higher.
If you use Grafana Cloud, open a &lt;a href=&#34;/profile/org#support&#34;&gt;support ticket in the Cloud Portal&lt;/a&gt; to access this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;strong&gt;Trace to logs&lt;/strong&gt; setting configures the &lt;a href=&#34;/docs/grafana/v10.1/explore/trace-integration/&#34;&gt;trace to logs feature&lt;/a&gt; that is available when you integrate Grafana with Tempo.&lt;/p&gt;
&lt;p&gt;There are two ways to configure the trace to logs feature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use a simplified configuration with default query, or&lt;/li&gt;
&lt;li&gt;Configure a custom query where you can use a &lt;a href=&#34;/docs/grafana/v10.1/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;h3 id=&#34;use-a-simple-configuration&#34;&gt;Use a simple configuration&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 trace it may be necessary to search in larger or shifted time range to find the desired logs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs 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 does not allow using dots in labels. In that case you can for example remap &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optionally switch on the &lt;strong&gt;Filter by trace ID&lt;/strong&gt; and/or &lt;strong&gt;Filter by span ID&lt;/strong&gt; setting to further filter the logs if your logs consistently contain trace or span IDs.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;Optionally select tags to map. These tags can be used in the custom query with &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable will interpolate 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&amp;rsquo;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 does not allow using 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; in such a case. If you don&amp;rsquo;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;.&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;variables-that-can-be-used-in-a-custom-query&#34;&gt;Variables that can be used in a custom query&lt;/h3&gt;
&lt;p&gt;To use a variable 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;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 only Loki or Splunk [logs] data sources.&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;, &lt;code&gt;deployment.environment&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;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 behind the &lt;code&gt;traceToMetrics&lt;/code&gt; [feature toggle][configure-grafana-feature-toggles].
If you use Grafana Cloud, open a &lt;a href=&#34;/profile/org#support&#34;&gt;support ticket in the Cloud Portal&lt;/a&gt; to access this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;strong&gt;Trace to metrics&lt;/strong&gt; setting configures the &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 feature&lt;/a&gt; available when integrating Grafana with Tempo.&lt;/p&gt;
&lt;p&gt;To configure trace to metrics:&lt;/p&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;Create any desired linked queries.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;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;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&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;h2 id=&#34;service-graph&#34;&gt;Service Graph&lt;/h2&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; feature.&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;h2 id=&#34;node-graph&#34;&gt;Node Graph&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Node Graph&lt;/strong&gt; setting enables the &lt;a href=&#34;/docs/grafana/v10.1/panels-visualizations/visualizations/node-graph/&#34;&gt;node graph visualization&lt;/a&gt;, which is disabled by default.&lt;/p&gt;
&lt;p&gt;Once enabled, Grafana displays the node graph above the trace view.&lt;/p&gt;
&lt;h2 id=&#34;tempo-search&#34;&gt;Tempo search&lt;/h2&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;h2 id=&#34;loki-search&#34;&gt;Loki search&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Loki search&lt;/strong&gt; setting configures the Loki search query type.&lt;/p&gt;
&lt;p&gt;Configure the &lt;strong&gt;Data source&lt;/strong&gt; setting to define which Loki instance you want to use to search traces.
You must configure &lt;a href=&#34;../../loki/#configure-derived-fields&#34;&gt;derived fields&lt;/a&gt; in the Loki instance.&lt;/p&gt;
&lt;h2 id=&#34;traceid-query&#34;&gt;TraceID query&lt;/h2&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 will narrow 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;h2 id=&#34;span-bar&#34;&gt;Span bar&lt;/h2&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;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 Grafana&amp;rsquo;s provisioning system.
For more information about provisioning and available configuration options, refer to &lt;a href=&#34;/docs/grafana/v10.1/administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Example provision YAML file:&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;
      serviceMap:
        datasourceUid: &amp;#39;prometheus&amp;#39;
      nodeGraph:
        enabled: true
      search:
        hide: false
      lokiSearch:
        datasourceUid: &amp;#39;loki&amp;#39;
      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;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="configure-the-tempo-data-source">Configure the Tempo data source&lt;/h1>
&lt;p>To configure basic settings for the Tempo data source, complete the following steps:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Click &lt;strong>Connections&lt;/strong> in the left-side menu.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Under Your connections, click &lt;strong>Data sources&lt;/strong>.&lt;/p></description></item><item><title>Tempo query editor</title><link>https://grafana.com/docs/grafana/v10.1/datasources/tempo/query-editor/</link><pubDate>Fri, 07 Mar 2025 11:34:44 +0100</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/tempo/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;tempo-query-editor&#34;&gt;Tempo query editor&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/v10.1/explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This topic explains configuration and queries specific to the Tempo data source.
For general documentation on querying data sources in Grafana, see &lt;a href=&#34;/docs/grafana/v10.1/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To add TraceQL panels to your dashboard, refer to the &lt;a href=&#34;/docs/grafana/latest/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/latest/dashboards/use-dashboards/&#34;&gt;Use dashboards documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;write-traceql-queries-in-grafana&#34;&gt;Write TraceQL queries in Grafana&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. You can use either the &lt;strong&gt;Query type&lt;/strong&gt; &amp;gt; &lt;strong&gt;Search&lt;/strong&gt; (the TraceQL query builder) or the &lt;strong&gt;TraceQL&lt;/strong&gt; tab (the TraceQL query editor).
Both of these methods let you build queries and drill-down into result sets.&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;h3 id=&#34;traceql-query-builder&#34;&gt;TraceQL query builder&lt;/h3&gt;
&lt;p&gt;The TraceQL query builder, located on the &lt;strong&gt;Explore&lt;/strong&gt; &amp;gt; &lt;strong&gt;Query type&lt;/strong&gt; &amp;gt; &lt;strong&gt;Search&lt;/strong&gt; in Grafana, provides drop-downs and text fields to help you write a query.&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;/static/img/docs/tempo/screenshot-traceql-query-type-search-v10.png&#34;
  alt=&#34;The TraceQL query builder&#34; width=&#34;861&#34;
     height=&#34;470&#34;/&gt;&lt;/p&gt;
&lt;h3 id=&#34;traceql-query-editor&#34;&gt;TraceQL query editor&lt;/h3&gt;
&lt;p&gt;The TraceQL query editor, located on the &lt;strong&gt;Explore&lt;/strong&gt; &amp;gt; &lt;strong&gt;TraceQL&lt;/strong&gt; tab in Grafana, 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;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;/static/img/docs/tempo/screenshot-traceql-query-editor-v10.png&#34;
  alt=&#34;The TraceQL query editor&#34; width=&#34;646&#34;
     height=&#34;387&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;query-by-search-deprecated&#34;&gt;Query by search (deprecated)&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Starting with Grafana v10.2, this query type has been deprecated. It will be removed in Grafana v10.3.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Use this to search for traces by service name, span name, duration range, or process-level attributes that are included in your application&amp;rsquo;s instrumentation, such as HTTP status code and customer ID.&lt;/p&gt;
&lt;p&gt;To configure Tempo and the Tempo data source for search, refer to &lt;a href=&#34;../#configure-the-data-source&#34;&gt;Configure the data source&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To search for traces:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Search&lt;/strong&gt; from the &lt;strong&gt;Query&lt;/strong&gt; type selector.&lt;/li&gt;
&lt;li&gt;Fill out the search form:&lt;/li&gt;
&lt;/ol&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;Service Name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of services.&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;Returns a list of span names.&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;Sets tags with values in the &lt;a href=&#34;https://brandur.org/logfmt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;logfmt&lt;/a&gt; format, such as &lt;code&gt;error=true db.statement=&amp;quot;select * from User&amp;quot;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Min Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Filters all traces with a duration higher than the set value. Possible values are &lt;code&gt;1.2s&lt;/code&gt;, &lt;code&gt;100ms&lt;/code&gt;, &lt;code&gt;500us&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Filters all traces with a duration lower than the set value. Possible values are &lt;code&gt;1.2s&lt;/code&gt;, &lt;code&gt;100ms&lt;/code&gt;, &lt;code&gt;500us&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Limit&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Limits the number of traces returned.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 750px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/tempo-search.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/tempo-search.png&#34;data-srcset=&#34;/static/img/docs/explore/tempo-search.png?w=320 320w, /static/img/docs/explore/tempo-search.png?w=550 550w, /static/img/docs/explore/tempo-search.png?w=750 750w, /static/img/docs/explore/tempo-search.png?w=900 900w, /static/img/docs/explore/tempo-search.png?w=1040 1040w, /static/img/docs/explore/tempo-search.png?w=1240 1240w, /static/img/docs/explore/tempo-search.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Tempo search feature with a trace rendered in the right panel&#34;width=&#34;2824&#34;height=&#34;1524&#34;title=&#34;Screenshot of the Tempo search feature with a trace rendered in the right panel&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/tempo-search.png&#34;
            alt=&#34;Screenshot of the Tempo search feature with a trace rendered in the right panel&#34;width=&#34;2824&#34;height=&#34;1524&#34;title=&#34;Screenshot of the Tempo search feature with a trace rendered in the right panel&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Tempo search feature with a trace rendered in the right panel&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;search-recent-traces&#34;&gt;Search recent traces&lt;/h3&gt;
&lt;p&gt;You can search recent traces held in Tempo&amp;rsquo;s ingesters.
By default, ingesters store the last 15 minutes of tracing data.&lt;/p&gt;
&lt;p&gt;To configure your Tempo data source to use this feature, refer to the &lt;a href=&#34;/docs/tempo/latest/getting-started/tempo-in-grafana/#search-of-recent-traces&#34;&gt;Tempo documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;search-the-backend-datastore&#34;&gt;Search the backend datastore&lt;/h3&gt;
&lt;p&gt;Tempo includes the ability to search the entire backend datastore.&lt;/p&gt;
&lt;p&gt;To configure your Tempo data source to use this feature, refer to the &lt;a href=&#34;/docs/tempo/latest/getting-started/tempo-in-grafana/#search-of-the-backend-datastore&#34;&gt;Tempo documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;query-by-traceid&#34;&gt;Query by TraceID&lt;/h2&gt;
&lt;p&gt;To query a particular trace:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;TraceQL&lt;/strong&gt; query type.&lt;/li&gt;
&lt;li&gt;Enter the trace&amp;rsquo;s ID into the query field.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 750px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/tempo/query-editor-traceid.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/tempo/query-editor-traceid.png&#34;data-srcset=&#34;/static/img/docs/tempo/query-editor-traceid.png?w=320 320w, /static/img/docs/tempo/query-editor-traceid.png?w=550 550w, /static/img/docs/tempo/query-editor-traceid.png?w=750 750w, /static/img/docs/tempo/query-editor-traceid.png?w=900 900w, /static/img/docs/tempo/query-editor-traceid.png?w=1040 1040w, /static/img/docs/tempo/query-editor-traceid.png?w=1240 1240w, /static/img/docs/tempo/query-editor-traceid.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Tempo TraceID query type&#34;width=&#34;1912&#34;height=&#34;974&#34;title=&#34;Screenshot of the Tempo TraceID query type&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/tempo/query-editor-traceid.png&#34;
            alt=&#34;Screenshot of the Tempo TraceID query type&#34;width=&#34;1912&#34;height=&#34;974&#34;title=&#34;Screenshot of the Tempo TraceID query type&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Tempo TraceID query type&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;query-loki-for-traces&#34;&gt;Query Loki for traces&lt;/h2&gt;
&lt;p&gt;To find traces to visualize, you can use the &lt;a href=&#34;../../loki/#loki-query-editor&#34;&gt;Loki query editor&lt;/a&gt;.
For results, you must configure &lt;a href=&#34;../../loki/#configure-derived-fields&#34;&gt;derived fields&lt;/a&gt; in the Loki data source that point to this data source.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 750px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/tempo/query-editor-search.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/tempo/query-editor-search.png&#34;data-srcset=&#34;/static/img/docs/tempo/query-editor-search.png?w=320 320w, /static/img/docs/tempo/query-editor-search.png?w=550 550w, /static/img/docs/tempo/query-editor-search.png?w=750 750w, /static/img/docs/tempo/query-editor-search.png?w=900 900w, /static/img/docs/tempo/query-editor-search.png?w=1040 1040w, /static/img/docs/tempo/query-editor-search.png?w=1240 1240w, /static/img/docs/tempo/query-editor-search.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Tempo query editor showing the Loki Search tab&#34;width=&#34;1912&#34;height=&#34;870&#34;title=&#34;Screenshot of the Tempo query editor showing the Loki Search tab&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/tempo/query-editor-search.png&#34;
            alt=&#34;Screenshot of the Tempo query editor showing the Loki Search tab&#34;width=&#34;1912&#34;height=&#34;870&#34;title=&#34;Screenshot of the Tempo query editor showing the Loki Search tab&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Tempo query editor showing the Loki Search tab&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
]]></content><description>&lt;h1 id="tempo-query-editor">Tempo query editor&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/v10.1/explore/">Explore&lt;/a>.&lt;/p>
&lt;p>This topic explains configuration and queries specific to the Tempo data source.
For general documentation on querying data sources in Grafana, see &lt;a href="/docs/grafana/v10.1/panels-visualizations/query-transform-data/">Query and transform data&lt;/a>.&lt;/p></description></item><item><title>Upload a JSON trace file</title><link>https://grafana.com/docs/grafana/v10.1/datasources/tempo/json-trace-file/</link><pubDate>Mon, 02 Oct 2023 08:04:34 +0000</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/tempo/json-trace-file/</guid><content><![CDATA[&lt;h1 id=&#34;upload-a-json-trace-file&#34;&gt;Upload a JSON trace file&lt;/h1&gt;
&lt;p&gt;You can upload a JSON file that contains a single trace and visualize it.
If the file has multiple traces, Grafana visualizes the first trace.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To download a trace or Service Graph through the inspector:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the inspector.&lt;/li&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Data&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Download traces&lt;/strong&gt; or &lt;strong&gt;Download Service Graph&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;trace-json-example&#34;&gt;Trace JSON example&lt;/h2&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;JSON&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-json&#34;&gt;{
  &amp;#34;batches&amp;#34;: [
    {
      &amp;#34;resource&amp;#34;: {
        &amp;#34;attributes&amp;#34;: [
          { &amp;#34;key&amp;#34;: &amp;#34;service.name&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;db&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;job&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;tns/db&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;opencensus.exporterversion&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;Jaeger-Go-2.22.1&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;host.name&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;63d16772b4a2&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;ip&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;0.0.0.0&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;client-uuid&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;39fb01637a579639&amp;#34; } }
        ]
      },
      &amp;#34;instrumentationLibrarySpans&amp;#34;: [
        {
          &amp;#34;instrumentationLibrary&amp;#34;: {},
          &amp;#34;spans&amp;#34;: [
            {
              &amp;#34;traceId&amp;#34;: &amp;#34;AAAAAAAAAABguiq7RPE&amp;#43;rg==&amp;#34;,
              &amp;#34;spanId&amp;#34;: &amp;#34;cmteMBAvwNA=&amp;#34;,
              &amp;#34;parentSpanId&amp;#34;: &amp;#34;OY8PIaPbma4=&amp;#34;,
              &amp;#34;name&amp;#34;: &amp;#34;HTTP GET - root&amp;#34;,
              &amp;#34;kind&amp;#34;: &amp;#34;SPAN_KIND_SERVER&amp;#34;,
              &amp;#34;startTimeUnixNano&amp;#34;: &amp;#34;1627471657255809000&amp;#34;,
              &amp;#34;endTimeUnixNano&amp;#34;: &amp;#34;1627471657256268000&amp;#34;,
              &amp;#34;attributes&amp;#34;: [
                { &amp;#34;key&amp;#34;: &amp;#34;http.status_code&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;intValue&amp;#34;: &amp;#34;200&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;http.method&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;GET&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;http.url&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;/&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;component&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;net/http&amp;#34; } }
              ],
              &amp;#34;status&amp;#34;: {}
            }
          ]
        }
      ]
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="upload-a-json-trace-file">Upload a JSON trace file&lt;/h1>
&lt;p>You can upload a JSON file that contains a single trace and visualize it.
If the file has multiple traces, Grafana visualizes the first trace.&lt;/p></description></item><item><title>Service Graph and Service Graph view</title><link>https://grafana.com/docs/grafana/v10.1/datasources/tempo/service-graph/</link><pubDate>Fri, 07 Mar 2025 11:34:44 +0100</pubDate><guid>https://grafana.com/docs/grafana/v10.1/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 captioned&#34;
        href=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;data-srcset=&#34;/static/img/docs/node-graph/node-graph-8-0.png?w=320 320w, /static/img/docs/node-graph/node-graph-8-0.png?w=550 550w, /static/img/docs/node-graph/node-graph-8-0.png?w=750 750w, /static/img/docs/node-graph/node-graph-8-0.png?w=900 900w, /static/img/docs/node-graph/node-graph-8-0.png?w=1040 1040w, /static/img/docs/node-graph/node-graph-8-0.png?w=1240 1240w, /static/img/docs/node-graph/node-graph-8-0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1768&#34;height=&#34;1288&#34;title=&#34;Screenshot of a Node Graph&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;
            alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1768&#34;height=&#34;1288&#34;title=&#34;Screenshot of a Node Graph&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of a Node Graph&lt;/figcaption&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-agent/&#34;&gt;Configure Grafana Agent&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;../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/v10.1/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/v10.1/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 captioned&#34;
        href=&#34;/static/img/docs/tempo/apm-table.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/tempo/apm-table.png&#34;data-srcset=&#34;/static/img/docs/tempo/apm-table.png?w=320 320w, /static/img/docs/tempo/apm-table.png?w=550 550w, /static/img/docs/tempo/apm-table.png?w=750 750w, /static/img/docs/tempo/apm-table.png?w=900 900w, /static/img/docs/tempo/apm-table.png?w=1040 1040w, /static/img/docs/tempo/apm-table.png?w=1240 1240w, /static/img/docs/tempo/apm-table.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Service Graph view&#34;width=&#34;1074&#34;height=&#34;258&#34;title=&#34;Screenshot of the Service Graph view&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/tempo/apm-table.png&#34;
            alt=&#34;Screenshot of the Service Graph view&#34;width=&#34;1074&#34;height=&#34;258&#34;title=&#34;Screenshot of the Service Graph view&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Service Graph view&lt;/figcaption&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/v10.1/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;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/v10.1/datasources/tempo/span-filters/</link><pubDate>Mon, 02 Oct 2023 08:04:34 +0000</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/tempo/span-filters/</guid><content><![CDATA[&lt;h1 id=&#34;span-filters&#34;&gt;Span Filters&lt;/h1&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;p&gt;To only show the spans you have matched, select the &lt;code&gt;Show matches only&lt;/code&gt; toggle.&lt;/p&gt;
&lt;!-- Adding these in case they are needed. --&gt;
]]></content><description>&lt;h1 id="span-filters">Span Filters&lt;/h1>
&lt;p>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></description></item><item><title>Link to a trace ID</title><link>https://grafana.com/docs/grafana/v10.1/datasources/tempo/link-trace-id/</link><pubDate>Fri, 07 Mar 2025 11:34:44 +0100</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/tempo/link-trace-id/</guid><content><![CDATA[&lt;h1 id=&#34;link-to-a-trace-id&#34;&gt;Link to a trace ID&lt;/h1&gt;
&lt;p&gt;You can link to Tempo traces from logs or metrics.&lt;/p&gt;
&lt;h2 id=&#34;link-to-a-trace-id-from-logs&#34;&gt;Link to a trace ID from logs&lt;/h2&gt;
&lt;p&gt;You can link to Tempo traces from logs in Loki, Elasticsearch, Splunk, and other logs data sources by configuring an internal link.&lt;/p&gt;
&lt;p&gt;To configure this feature, see the &lt;a href=&#34;../../loki/#configure-derived-fields&#34;&gt;Derived fields&lt;/a&gt; section of the Loki data source docs or the &lt;a href=&#34;../../elasticsearch/#data-links&#34;&gt;Data links&lt;/a&gt; section of the Elasticsearch or Splunk data source docs.&lt;/p&gt;
&lt;h2 id=&#34;link-to-a-trace-id-from-metrics&#34;&gt;Link to a trace ID from metrics&lt;/h2&gt;
&lt;p&gt;You can link to Tempo traces from metrics in Prometheus data sources by configuring an exemplar.&lt;/p&gt;
&lt;p&gt;To configure this feature, see the &lt;a href=&#34;/docs/grafana/v10.1/fundamentals/exemplars/&#34;&gt;introduction to exemplars&lt;/a&gt; documentation.&lt;/p&gt;
]]></content><description>&lt;h1 id="link-to-a-trace-id">Link to a trace ID&lt;/h1>
&lt;p>You can link to Tempo traces from logs or metrics.&lt;/p>
&lt;h2 id="link-to-a-trace-id-from-logs">Link to a trace ID from logs&lt;/h2>
&lt;p>You can link to Tempo traces from logs in Loki, Elasticsearch, Splunk, and other logs data sources by configuring an internal link.&lt;/p></description></item></channel></rss>