<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure the Tempo data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/</link><description>Recent content in Configure the Tempo data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure trace to logs correlation</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/</link><pubDate>Thu, 16 Apr 2026 20:21:47 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/</guid><content><![CDATA[&lt;h1 id=&#34;configure-trace-to-logs-correlation&#34;&gt;Configure trace to logs correlation&lt;/h1&gt;
&lt;p&gt;Trace to logs correlation lets you navigate from a span in Tempo directly to the matching logs in Loki, and from a log line in Loki back to its trace in Tempo.
When configured, a &lt;strong&gt;Logs for this span&lt;/strong&gt; link appears in the trace view and a link to the configured tracing data source appears on log lines that contain a trace ID.&lt;/p&gt;
&lt;p&gt;This is a two data source configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tempo data source:&lt;/strong&gt; Controls how Grafana queries logs when you click a span, including the time window, query, and tags to match.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Loki data source:&lt;/strong&gt; Controls how trace IDs are extracted from log lines and linked back to traces.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both sides must be configured for the correlation to work in either direction.&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;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To configure trace to logs correlation, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Tempo data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/loki/configure-loki-data-source/&#34;&gt;Loki data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;Applications that emit traces and logs with a shared identifier such as a trace ID, service name, or both&lt;/li&gt;
&lt;li&gt;Editor or Admin permissions in Grafana&lt;/li&gt;
&lt;/ul&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 from the Grafana UI. If you&amp;rsquo;re using Grafana Cloud Traces (the pre-configured tracing data source in Grafana Cloud), its settings are read-only.
To configure trace to logs, 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/#clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;clone the data source&lt;/a&gt; to create an editable copy, or update the provisioning file for self-managed instances.
Refer to &lt;a href=&#34;#provision-trace-to-logs-settings&#34;&gt;Provision trace to logs settings&lt;/a&gt; for details.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;configure-the-tempo-data-source&#34;&gt;Configure the Tempo data source&lt;/h2&gt;
&lt;p&gt;These settings control how Grafana queries your log data source when you click a span in the trace view.
This guide uses Loki, but Trace to logs also supports Elasticsearch, Splunk, OpenSearch, Falcon LogScale, Google Cloud Logging, and VictoriaMetrics Logs.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt; and select your Tempo data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scroll to the &lt;strong&gt;Trace to logs&lt;/strong&gt; section.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select your Loki data source from the &lt;strong&gt;Data source&lt;/strong&gt; drop-down list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;strong&gt;Span start time shift&lt;/strong&gt; and &lt;strong&gt;Span end time shift&lt;/strong&gt; fields.&lt;/p&gt;
&lt;p&gt;These fields expand the log query time window around the span&amp;rsquo;s start and end timestamps.
A span&amp;rsquo;s timestamps are precise to the millisecond, but log lines are often written slightly before or after the span boundary.
The default value of &lt;code&gt;0&lt;/code&gt; can return no logs if timestamps don&amp;rsquo;t align exactly.
A common starting point is &lt;code&gt;-2s&lt;/code&gt; for start shift and &lt;code&gt;2s&lt;/code&gt; for end shift.&lt;/p&gt;
&lt;p&gt;You can increase this value for spans that represent slow or batch operations, for example &lt;code&gt;5s&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure &lt;strong&gt;Tags&lt;/strong&gt; to map span attributes to Loki label names.&lt;/p&gt;
&lt;p&gt;Grafana uses these tags to filter logs to the correct service, Pod, or cluster.
The Loki label name you enter must exactly match the label name on your Loki streams.
A mismatch silently breaks the correlation with no error shown.&lt;/p&gt;
&lt;p&gt;If you don&amp;rsquo;t configure any tags, Grafana uses the following defaults: &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; (remapped to &lt;code&gt;service_name&lt;/code&gt;), and &lt;code&gt;service.namespace&lt;/code&gt; (remapped to &lt;code&gt;service_namespace&lt;/code&gt;).
The automatic dot-to-underscore remapping only applies to these default tags. For custom tags, you must specify the remapped name explicitly.&lt;/p&gt;
&lt;p&gt;To customize the mapping, use the &lt;strong&gt;Add tag&lt;/strong&gt; button to add each row.
The following table shows common tags and their typical Loki label equivalents:&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;Span attribute&lt;/th&gt;
              &lt;th&gt;Loki label&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;service.name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;service_name&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;service.namespace&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;service_namespace&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;cluster&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;cluster&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;namespace&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;namespace&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;pod&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;pod&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Choose labels with low cardinality.
In Loki, every unique combination of label values creates a separate stream.
Labels that take on many distinct values, such as &lt;code&gt;pod&lt;/code&gt;, &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;thread&lt;/code&gt;, &lt;code&gt;duration&lt;/code&gt;, &lt;code&gt;traceId&lt;/code&gt;, or &lt;code&gt;spanId&lt;/code&gt;, can create hundreds of thousands or even millions of streams, causing slow queries, high memory usage, and log loss at ingest.
The labels listed above (&lt;code&gt;service_name&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;cluster&lt;/code&gt;) are good choices because they have a bounded, small set of values.
If you need to query high-cardinality values like trace IDs or Pod names, store them as &lt;a href=&#34;/docs/loki/latest/get-started/labels/structured-metadata/&#34;&gt;structured metadata&lt;/a&gt; instead. They are queryable without creating additional streams.
For more information, refer to &lt;a href=&#34;/docs/loki/latest/get-started/labels/cardinality/&#34;&gt;Cardinality&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;When using Loki, the &lt;strong&gt;Logs for this span&lt;/strong&gt; link only appears on a span if at least one of the configured tags exists on that span.
If none of the tags match, the link doesn&amp;rsquo;t appear and no error is shown.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the &lt;strong&gt;Filter by trace ID&lt;/strong&gt; and &lt;strong&gt;Filter by span ID&lt;/strong&gt; toggles.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Filter by trace ID:&lt;/strong&gt; Filters Loki results to all logs for the entire trace, not just the selected span. This works well for most use cases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter by span ID:&lt;/strong&gt; Filters to logs for a single span. This only works if your logs include a span ID field.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These toggles are disabled when &lt;strong&gt;Use custom query&lt;/strong&gt; is enabled because the custom query controls filtering directly.&lt;/p&gt;
&lt;p&gt;Clicking &lt;strong&gt;Logs for this span&lt;/strong&gt; filters by trace ID, not span ID, so results include all logs for the entire trace that contain a matching trace ID, not only logs emitted during that specific span.
If your results look broader than expected, this is expected behavior.
To narrow results to a specific span&amp;rsquo;s activity, write a custom LogQL query that filters on span ID or span-specific attributes if your application logs them, for example &lt;code&gt;{service_name=&amp;quot;my-service&amp;quot;} | json | spanId=&amp;quot;&amp;quot;&lt;/code&gt;.
For this feature to work at all, your application must inject trace IDs into log lines, for example, using OpenTelemetry SDK structured logging.
Without trace IDs in logs, the query falls back to a time-range filter.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Enable &lt;strong&gt;Use custom query&lt;/strong&gt; and write a LogQL expression to replace the auto-generated query.&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;${__tags}&lt;/code&gt; to inject the mapped tag filters automatically:&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;logql&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-logql&#34;&gt;{${__tags}} | logfmt | trace_id=`${__trace.traceId}`&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If a tag like &lt;code&gt;pod&lt;/code&gt; is stored as Loki &lt;a href=&#34;/docs/loki/latest/get-started/labels/structured-metadata/&#34;&gt;structured metadata&lt;/a&gt; instead of an indexed label, it can&amp;rsquo;t appear in the stream selector &lt;code&gt;{}&lt;/code&gt;. Move it to a pipeline filter instead:&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;logql&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-logql&#34;&gt;{${__tags}} | pod=`${__span.tags[&amp;#34;k8s.pod.name&amp;#34;]}` |= `${__trace.traceId}`&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/#custom-query-variables&#34;&gt;Custom query variables&lt;/a&gt; for the full list of available variables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-the-loki-data-source&#34;&gt;Configure the Loki data source&lt;/h2&gt;
&lt;p&gt;These settings enable the &lt;strong&gt;Tempo&lt;/strong&gt; link on Loki log lines, letting you navigate from a log entry to its trace.&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;Configuring the Tempo data source without also configuring the Loki data source is a common mistake.
If you skip this step, clicking a log line doesn&amp;rsquo;t open a trace.
Both sides are required.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Connections&lt;/strong&gt; &amp;gt; &lt;strong&gt;Data sources&lt;/strong&gt; and select your Loki data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Additional settings&lt;/strong&gt; section, scroll to &lt;strong&gt;Derived fields&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add&lt;/strong&gt; to add a new derived field.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a &lt;strong&gt;Name&lt;/strong&gt; for the field, for example &lt;code&gt;TraceID&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Type&lt;/strong&gt; and enter a pattern to extract the trace ID from log lines.&lt;/p&gt;
&lt;p&gt;If you select &lt;strong&gt;Regex in log line&lt;/strong&gt;, enter a regular expression with one capture group.
The following table shows common patterns:&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;Log format&lt;/th&gt;
              &lt;th&gt;Regex&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;traceID=&amp;lt;VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;traceID=(\w&#43;)&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;trace_id=&amp;lt;VALUE&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;trace_id=(\w&#43;)&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;JSON field &lt;code&gt;&amp;quot;traceId&amp;quot;: &amp;quot;&amp;lt;VALUE&amp;gt;&amp;quot;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&amp;quot;traceId&amp;quot;:&amp;quot;(\w&#43;)&amp;quot;&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;If you select &lt;strong&gt;Label&lt;/strong&gt;, enter a regular expression that matches the label key, for example &lt;code&gt;trace[_]?id&lt;/code&gt; to match both &lt;code&gt;traceid&lt;/code&gt; and &lt;code&gt;trace_id&lt;/code&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;If your applications use different trace ID field names, you need a separate derived field entry for each format.
To simplify this, standardize on OpenTelemetry structured metadata so trace IDs are stored as a consistent label.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enable the &lt;strong&gt;Internal link&lt;/strong&gt; toggle and select your Tempo data source from the drop-down list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Query&lt;/strong&gt; field, enter &lt;code&gt;${__value.raw}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This passes the extracted trace ID to Tempo when the link is clicked.
The field shows &lt;code&gt;${__value.raw}&lt;/code&gt; as placeholder text, but you must enter it as the actual value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more details about derived field options, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/loki/configure-loki-data-source/#derived-fields&#34;&gt;Derived fields&lt;/a&gt; in the Loki data source documentation.&lt;/p&gt;
&lt;h2 id=&#34;provision-trace-to-logs-settings&#34;&gt;Provision trace to logs settings&lt;/h2&gt;
&lt;p&gt;You can provision the trace to logs configuration using the &lt;code&gt;tracesToLogsV2&lt;/code&gt; block in your data source YAML file.
For the full provisioning YAML example including all Tempo settings, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;.
For general provisioning instructions, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/administration/provisioning/#data-sources&#34;&gt;Provisioning data sources&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;example-nginx-service&#34;&gt;Example: NGINX service&lt;/h2&gt;
&lt;p&gt;This example assumes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Applications running in Kubernetes that emit OpenTelemetry traces to Tempo&lt;/li&gt;
&lt;li&gt;Logs sent to Loki with labels &lt;code&gt;service_name&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, and &lt;code&gt;pod&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Trace IDs written to logs as &lt;code&gt;trace_id=&amp;lt;VALUE&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Tempo data source settings are:&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;Field&lt;/th&gt;
              &lt;th&gt;Value&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;Loki&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;&lt;code&gt;-2s&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;&lt;code&gt;2s&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;&lt;code&gt;service.name&lt;/code&gt; mapped to &lt;code&gt;service_name&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;pod&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;Enabled&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;Disabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;The Loki data source derived field settings are:&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;Field&lt;/th&gt;
              &lt;th&gt;Value&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;TraceID&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Regex in log line&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Regex&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;trace_id=(\w&#43;)&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Internal link&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enabled, select Tempo&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;&lt;code&gt;${__value.raw}&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;expected-result&#34;&gt;Expected result&lt;/h3&gt;
&lt;p&gt;After configuring both data sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;Explore&lt;/strong&gt; with the Tempo data source selected, click any span and then click &lt;strong&gt;Logs for this span&lt;/strong&gt;. Loki opens filtered to &lt;code&gt;service_name=nginx&lt;/code&gt; and &lt;code&gt;namespace=production&lt;/code&gt; within the configured time window around the span.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Explore&lt;/strong&gt; with the Loki data source selected, any log line containing &lt;code&gt;trace_id=...&lt;/code&gt; shows a link to your Tempo data source. Clicking it opens the full trace in Tempo.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If trace to logs links aren&amp;rsquo;t appearing, return no data, or only work for some services, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/troubleshooting/#trace-to-logsmetricsprofiles-issues&#34;&gt;Trace to logs/metrics/profiles issues&lt;/a&gt; in the troubleshooting guide.&lt;/p&gt;
&lt;p&gt;If the configuration fields are greyed out, your data source is provisioned. Refer to &lt;a href=&#34;#provision-trace-to-logs-settings&#34;&gt;Provision trace to logs settings&lt;/a&gt; for options.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/&#34;&gt;Configure trace to metrics correlation&lt;/a&gt;: Link spans to metrics queries in Prometheus.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/&#34;&gt;Configure trace to profiles correlation&lt;/a&gt;: Link spans to profiling data in Grafana Pyroscope.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Configure the Tempo data source&lt;/a&gt;: Return to connection, authentication, and streaming settings.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-trace-to-logs-correlation">Configure trace to logs correlation&lt;/h1>
&lt;p>Trace to logs correlation lets you navigate from a span in Tempo directly to the matching logs in Loki, and from a log line in Loki back to its trace in Tempo.
When configured, a &lt;strong>Logs for this span&lt;/strong> link appears in the trace view and a link to the configured tracing data source appears on log lines that contain a trace ID.&lt;/p></description></item><item><title>Configure trace to metrics correlation</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/</link><pubDate>Tue, 14 Apr 2026 14:59:56 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/</guid><content><![CDATA[&lt;h1 id=&#34;configure-trace-to-metrics-correlation&#34;&gt;Configure trace to metrics correlation&lt;/h1&gt;
&lt;p&gt;Trace to metrics lets you navigate from a span in a trace to metrics in a Prometheus or other metrics data source.
When configured, a &lt;strong&gt;Metrics for this span&lt;/strong&gt; link appears in the trace view.&lt;/p&gt;
&lt;p&gt;Trace to metrics works with any Prometheus-compatible data source and doesn&amp;rsquo;t require the Tempo metrics generator.
The metrics generator creates &lt;em&gt;new&lt;/em&gt; metrics from trace data; trace to metrics links to metrics that &lt;em&gt;already exist&lt;/em&gt; in your metrics data source.&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;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To configure trace to metrics, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Tempo data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;A Prometheus-compatible metrics data source configured in Grafana&lt;/li&gt;
&lt;li&gt;Metrics that correspond to your traced services (for example, &lt;code&gt;requests_total&lt;/code&gt;, &lt;code&gt;request_duration_seconds&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Editor or Admin permissions in Grafana&lt;/li&gt;
&lt;/ul&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 from the Grafana UI. If you&amp;rsquo;re using Grafana Cloud Traces (the pre-configured tracing data source in Grafana Cloud), its settings are read-only.
To configure trace to metrics, 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/#clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;clone the data source&lt;/a&gt; to create an editable copy, or update the provisioning file for self-managed instances.
Refer to the &lt;a href=&#34;#provisioning&#34;&gt;Provisioning&lt;/a&gt; section for details.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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.&lt;/li&gt;
&lt;li&gt;Configure one or more custom queries where you can use a 
    &lt;a href=&#34;/docs/grafana/v13.0/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;&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;h2 id=&#34;set-up-a-basic-configuration&#34;&gt;Set up a basic configuration&lt;/h2&gt;
&lt;p&gt;To use a basic 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;. The placeholders show &lt;code&gt;-2m&lt;/code&gt; (start) and &lt;code&gt;2m&lt;/code&gt; (end), which are applied if you leave the fields empty.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Choose any tags to use in the query. Click &lt;strong&gt;Add tag&lt;/strong&gt; to add a tag mapping.&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 if 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;.&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;h2 id=&#34;set-up-custom-queries&#34;&gt;Set up custom queries&lt;/h2&gt;
&lt;p&gt;To use custom queries, you need to configure the tags you&amp;rsquo;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&amp;rsquo;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&amp;rsquo; values.&lt;/p&gt;
&lt;p&gt;You can link to any metric you&amp;rsquo;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. Click &lt;strong&gt;Add tag&lt;/strong&gt; to add a tag mapping.&lt;/p&gt;
&lt;p&gt;These tags can be used in the custom query with the &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable interpolates the mapped tags as a list in an appropriate syntax for the data source and only includes 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 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&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;. Refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/#custom-query-variables&#34;&gt;Custom query variables&lt;/a&gt; for the full list of available variables.&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;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table describes options for configuring the &lt;strong&gt;Trace to metrics&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;&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;-2m&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;2m&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;provisioning&#34;&gt;Provisioning&lt;/h2&gt;
&lt;p&gt;You can provision the trace to metrics configuration using the &lt;code&gt;tracesToMetrics&lt;/code&gt; block in your data source YAML file.
For the full provisioning YAML example including all Tempo settings, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;link-from-metrics-to-traces&#34;&gt;Link from metrics to traces&lt;/h2&gt;
&lt;p&gt;To navigate in the reverse direction, from a metric to its associated trace, configure exemplars in your Prometheus data source. Refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/fundamentals/exemplars/&#34;&gt;Exemplars&lt;/a&gt; for setup instructions.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If trace to metrics links aren&amp;rsquo;t appearing or return no data, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/troubleshooting/#trace-to-logsmetricsprofiles-issues&#34;&gt;Trace to logs/metrics/profiles issues&lt;/a&gt; in the troubleshooting guide.&lt;/p&gt;
&lt;p&gt;If the configuration fields are greyed out, your data source is provisioned. Refer to the &lt;a href=&#34;#provisioning&#34;&gt;Provisioning&lt;/a&gt; section for how to update the configuration via YAML.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;: Navigate from spans to related logs in Loki.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/&#34;&gt;Configure trace to profiles correlation&lt;/a&gt;: Link spans to profiling data in Grafana Pyroscope.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;: Configure the Tempo data source using a YAML file.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-trace-to-metrics-correlation">Configure trace to metrics correlation&lt;/h1>
&lt;p>Trace to metrics lets you navigate from a span in a trace to metrics in a Prometheus or other metrics data source.
When configured, a &lt;strong>Metrics for this span&lt;/strong> link appears in the trace view.&lt;/p></description></item><item><title>Configure trace to profiles correlation</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/</link><pubDate>Tue, 14 Apr 2026 14:59:56 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/</guid><content><![CDATA[&lt;h1 id=&#34;configure-trace-to-profiles-correlation&#34;&gt;Configure trace to profiles correlation&lt;/h1&gt;
&lt;p&gt;Trace to profiles lets you navigate from a span in a trace directly to profiling data in 
    &lt;a href=&#34;/docs/pyroscope/latest/&#34;&gt;Grafana Pyroscope&lt;/a&gt;. When configured, a &lt;strong&gt;Profiles for this span&lt;/strong&gt; button and an embedded flame graph appear in the span details view.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To configure trace to profiles, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Tempo data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/grafana-pyroscope/&#34;&gt;Grafana Pyroscope data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;An application instrumented with the 
    &lt;a href=&#34;/docs/pyroscope/latest/configure-client/trace-span-profiles/&#34;&gt;OpenTelemetry span profiling bridge&lt;/a&gt; so that spans include the &lt;code&gt;pyroscope.profile.id&lt;/code&gt; attribute&lt;/li&gt;
&lt;li&gt;Editor or Admin permissions in Grafana&lt;/li&gt;
&lt;/ul&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 from the Grafana UI. If you&amp;rsquo;re using Grafana Cloud Traces (the pre-configured tracing data source in Grafana Cloud), its settings are read-only.
To configure trace to profiles, 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/#clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;clone the data source&lt;/a&gt; to create an editable copy, or update the provisioning file for self-managed instances.
Refer to the &lt;a href=&#34;#provisioning&#34;&gt;Provisioning&lt;/a&gt; section for details.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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 the ability to correlate different signals in Grafana 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;h3 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h3&gt;
&lt;p&gt;To use Trace to profiles, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/grafana-pyroscope/&#34;&gt;Grafana Pyroscope data source&lt;/a&gt; connected to your Pyroscope instance.&lt;/li&gt;
&lt;li&gt;A Tempo data source configured with the Trace to profiles settings described on this page.&lt;/li&gt;
&lt;li&gt;Your application instrumented with all three of the following:
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Profiling&lt;/strong&gt;: A Pyroscope SDK or Grafana Alloy sending profiling data to Pyroscope. Refer to 
    &lt;a href=&#34;/docs/pyroscope/latest/configure-client/&#34;&gt;Configure the client to send profiles&lt;/a&gt; for setup instructions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tracing&lt;/strong&gt;: An OpenTelemetry SDK sending trace data to Tempo. Refer to the &lt;a href=&#34;https://opentelemetry.io/docs/getting-started/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry getting started documentation&lt;/a&gt; for setup instructions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Span profiling bridge&lt;/strong&gt;: A language-specific OpenTelemetry integration package that links profiling data with trace spans. Without this package, traces and profiles are independent signals with no connection between them. Refer to 
    &lt;a href=&#34;/docs/pyroscope/latest/configure-client/trace-span-profiles/&#34;&gt;Link tracing and profiling with span profiles&lt;/a&gt; for per-language setup instructions.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;use-a-basic-configuration&#34;&gt;Use a basic configuration&lt;/h3&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&amp;rsquo;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;h3 id=&#34;configure-custom-query-traces-profiles&#34;&gt;Configure a custom query&lt;/h3&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&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;. Learn more about 
    &lt;a href=&#34;/docs/grafana/v13.0/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;h3 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h3&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 to use 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;provisioning&#34;&gt;Provisioning&lt;/h2&gt;
&lt;p&gt;You can provision the trace to profiles configuration using the &lt;code&gt;tracesToProfiles&lt;/code&gt; block in your data source YAML file.
For the full provisioning YAML example including all Tempo settings, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;verify-the-integration&#34;&gt;Verify the integration&lt;/h2&gt;
&lt;p&gt;After configuring trace to profiles, verify the integration:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Explore&lt;/strong&gt; and select your Tempo data source.&lt;/li&gt;
&lt;li&gt;Run a query to load a trace.&lt;/li&gt;
&lt;li&gt;Expand a span and confirm that the &lt;strong&gt;Profiles for this span&lt;/strong&gt; button appears in the span details.&lt;/li&gt;
&lt;li&gt;Click the button and verify that an embedded flame graph loads with profiling data.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If trace to profiles links aren&amp;rsquo;t appearing or the flame graph is empty, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/troubleshooting/#trace-to-logsmetricsprofiles-issues&#34;&gt;Trace to logs/metrics/profiles issues&lt;/a&gt; in the troubleshooting guide. For additional diagnosis steps, refer to 
    &lt;a href=&#34;/docs/pyroscope/latest/configure-client/trace-span-profiles/&#34;&gt;Troubleshoot trace to profiles&lt;/a&gt; in the Pyroscope documentation.&lt;/p&gt;
&lt;p&gt;If the configuration fields are greyed out, your data source is provisioned. Refer to the &lt;a href=&#34;#provisioning&#34;&gt;Provisioning&lt;/a&gt; section for how to update the configuration via YAML.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;: Navigate from spans to related logs in Loki.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/&#34;&gt;Configure trace to metrics correlation&lt;/a&gt;: Link spans to metrics queries in Prometheus.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;: Configure the Tempo data source using a YAML file.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-trace-to-profiles-correlation">Configure trace to profiles correlation&lt;/h1>
&lt;p>Trace to profiles lets you navigate from a span in a trace directly to profiling data in
&lt;a href="/docs/pyroscope/latest/">Grafana Pyroscope&lt;/a>. When configured, a &lt;strong>Profiles for this span&lt;/strong> button and an embedded flame graph appear in the span details view.&lt;/p></description></item><item><title>Additional settings</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/additional-settings/</link><pubDate>Tue, 14 Apr 2026 14:59:56 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/additional-settings/</guid><content><![CDATA[&lt;h1 id=&#34;additional-settings&#34;&gt;Additional settings&lt;/h1&gt;
&lt;p&gt;The &lt;strong&gt;Additional settings&lt;/strong&gt; section of the Tempo data source settings contains options that most users don&amp;rsquo;t need to change. These settings are collapsed by default.&lt;/p&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;p&gt;This page covers the following settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#advanced-http-settings&#34;&gt;Advanced HTTP settings&lt;/a&gt;&lt;/strong&gt;: Configure cookie forwarding and request timeout&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#service-graph&#34;&gt;Service graph&lt;/a&gt;&lt;/strong&gt;: Link a Prometheus data source for Service Graph visualization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#node-graph&#34;&gt;Node graph&lt;/a&gt;&lt;/strong&gt;: Enable the node graph above the trace view&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#tempo-search&#34;&gt;Tempo search&lt;/a&gt;&lt;/strong&gt;: Show or hide the search option in Explore&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#traceid-query&#34;&gt;TraceID query&lt;/a&gt;&lt;/strong&gt;: Narrow TraceID lookups to a time range for performance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#tags-time-range&#34;&gt;Tags time range&lt;/a&gt;&lt;/strong&gt;: Control the time window for tag and tag-value queries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#tag-limit&#34;&gt;Tag limit&lt;/a&gt;&lt;/strong&gt;: Set the maximum number of tags retrieved from Tempo&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#span-bar&#34;&gt;Span bar&lt;/a&gt;&lt;/strong&gt;: Display duration or a custom tag in the span bar&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;#private-data-source-connect&#34;&gt;Private data source connect&lt;/a&gt;&lt;/strong&gt;: Connect to data sources in private networks&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;advanced-http-settings&#34;&gt;Advanced HTTP settings&lt;/h2&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;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-from-traces/service_graphs/enable-service-graphs/&#34;&gt;Service Graph&lt;/a&gt; data.&lt;/p&gt;
&lt;p&gt;You must link a Prometheus data source in the &lt;strong&gt;Data source&lt;/strong&gt; setting for the 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/service-graph/&#34;&gt;Service Graph&lt;/a&gt; to display data. Without this, Service Graph queries return empty results.&lt;/p&gt;
&lt;p&gt;The linked Prometheus data source must contain metrics generated by 
    &lt;a href=&#34;/docs/tempo/latest/configuration/grafana-alloy/&#34;&gt;Grafana Alloy&lt;/a&gt; or the 
    &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service_graphs/#tempo&#34;&gt;Tempo metrics generator&lt;/a&gt;. For the full list of prerequisites and troubleshooting steps, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/service-graph/&#34;&gt;Service Graph and Service Graph view&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;If you cloned a provisioned data source (for example, the Grafana Cloud Traces data source) and the &lt;strong&gt;Service graph&lt;/strong&gt; section doesn&amp;rsquo;t appear in the cloned data source&amp;rsquo;s settings, verify that the cloned data source has the same Tempo backend URL and authentication configured. The Service graph section only appears when the data source can connect to Tempo successfully. Refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/#clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;Clone a provisioned data source for Grafana Cloud&lt;/a&gt; for setup steps.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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/v13.0/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;After it&amp;rsquo;s activated, 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;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 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;Use time range in query&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 for start of search&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 for end of search&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;tags-time-range&#34;&gt;Tags time range&lt;/h2&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;h2 id=&#34;tag-limit&#34;&gt;Tag limit&lt;/h2&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;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;private-data-source-connect&#34;&gt;Private data source connect&lt;/h2&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;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Configure the Tempo data source&lt;/a&gt;: Return to connection, authentication, and streaming settings.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/&#34;&gt;Provision the Tempo data source&lt;/a&gt;: Configure the Tempo data source using a YAML file.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/service-graph/&#34;&gt;Service Graph and Service Graph view&lt;/a&gt;: Visualize service dependencies and monitor RED metrics.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="additional-settings">Additional settings&lt;/h1>
&lt;p>The &lt;strong>Additional settings&lt;/strong> section of the Tempo data source settings contains options that most users don&amp;rsquo;t need to change. These settings are collapsed by default.&lt;/p></description></item><item><title>Provision the Tempo data source</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/</link><pubDate>Tue, 14 Apr 2026 14:59:56 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/provision/</guid><content><![CDATA[&lt;h1 id=&#34;provision-the-tempo-data-source&#34;&gt;Provision the Tempo data source&lt;/h1&gt;
&lt;p&gt;You can define and configure the Tempo data source in YAML files as part of the Grafana provisioning system.&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;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;Provisioning via YAML is primarily used for self-managed Grafana instances.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;For more information about provisioning and available configuration options, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;provisioned-data-sources&#34;&gt;Provisioned data sources&lt;/h2&gt;
&lt;p&gt;You can&amp;rsquo;t modify a provisioned data source from the Grafana UI. The settings form is read-only and the &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; button is replaced by &lt;strong&gt;Test&lt;/strong&gt; (you can test the connection but not save changes).&lt;/p&gt;
&lt;p&gt;To make changes, you can either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Clone the data source:&lt;/strong&gt; Create a new data source of the same type and copy the settings from the provisioned data source. 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 detailed steps.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Update the provisioning file:&lt;/strong&gt; Edit the YAML configuration file and restart Grafana, or wait for the provisioning system to pick up the change. Any setting, including span time shifts on trace to logs, can be changed by editing the YAML.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;example-file&#34;&gt;Example file&lt;/h2&gt;
&lt;p&gt;This example provisioning YAML file sets up the equivalents of the options available in the Tempo data source UI.
Replace &lt;code&gt;grafana-pyroscope-datasource&lt;/code&gt; with the actual UID of your Pyroscope datasource, and verify the other &lt;code&gt;datasource Uid&lt;/code&gt; values match what&amp;rsquo;s actually provisioned.&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: [{ key: &amp;#39;job&amp;#39; }, { key: &amp;#39;instance&amp;#39; }, { key: &amp;#39;pod&amp;#39; }, { key: &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: [{ key: &amp;#39;job&amp;#39; }, { key: &amp;#39;instance&amp;#39; }, { key: &amp;#39;pod&amp;#39; }, { key: &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
        metrics: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For details about individual settings, refer to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;: &lt;code&gt;tracesToLogsV2&lt;/code&gt; block&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/&#34;&gt;Configure trace to metrics correlation&lt;/a&gt;: &lt;code&gt;tracesToMetrics&lt;/code&gt; block&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/&#34;&gt;Configure trace to profiles correlation&lt;/a&gt;: &lt;code&gt;tracesToProfiles&lt;/code&gt; block&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/additional-settings/&#34;&gt;Additional settings&lt;/a&gt;: &lt;code&gt;serviceMap&lt;/code&gt;, &lt;code&gt;nodeGraph&lt;/code&gt;, &lt;code&gt;search&lt;/code&gt;, &lt;code&gt;traceQuery&lt;/code&gt;, &lt;code&gt;spanBar&lt;/code&gt; blocks&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;clone-a-provisioned-data-source-for-grafana-cloud&#34;&gt;Clone a provisioned data source for Grafana Cloud&lt;/h2&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, if you want to edit the trace to logs settings in your Tempo data source that is provisioned on Grafana Cloud, you can enable traceID and spanID filtering by cloning the data source.&lt;/p&gt;
&lt;p&gt;To clone a provisioned data source, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&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;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/#add-a-new-data-source&#34;&gt;Create a new data source&lt;/a&gt; of the same type you want to clone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&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;/p&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;/li&gt;
&lt;/ol&gt;
&lt;p&gt;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;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Configure the Tempo data source&lt;/a&gt;: Return to connection, authentication, and streaming settings.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;: Set up span-to-log navigation.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/additional-settings/&#34;&gt;Additional settings&lt;/a&gt;: Configure Service graph, node graph, search, and other settings.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="provision-the-tempo-data-source">Provision the Tempo data source&lt;/h1>
&lt;p>You can define and configure the Tempo data source in YAML files as part of the Grafana provisioning system.&lt;/p>
&lt;p>You can use version control, like Git, to track and manage file changes.
Changes can be updated or rolled back as needed.&lt;/p></description></item><item><title>Trace correlations</title><link>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/trace-correlations/</link><pubDate>Thu, 16 Apr 2026 20:21:47 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/trace-correlations/</guid><content><![CDATA[&lt;h1 id=&#34;trace-correlations&#34;&gt;Trace correlations&lt;/h1&gt;
&lt;p&gt;You can use Grafana 
    &lt;a href=&#34;/docs/grafana/v13.0/administration/correlations/&#34;&gt;correlations&lt;/a&gt; to embed interactive correlation links in your trace view to jump from spans to related logs, metrics, profiles, or external systems. This guide explains how to configure and manage Trace correlations in Grafana.&lt;/p&gt;
&lt;h2 id=&#34;what-are-trace-correlations&#34;&gt;What are trace correlations?&lt;/h2&gt;
&lt;p&gt;Trace correlations let you define rules that inject context-sensitive links into your trace spans. When viewing traces in Explore or the Traces panel, users can click these links to navigate directly to relevant queries or URLs. Correlations are similar but more flexible to the 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;trace to logs, metrics, and profiles links you can configure for the Tempo data source&lt;/a&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 900px;&#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/tempo/screenshot-trace-view-correlations.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/tempo/screenshot-trace-view-correlations.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-trace-view-correlations.png?w=320 320w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=550 550w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=750 750w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=900 900w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=1040 1040w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=1240 1240w, /media/docs/tempo/screenshot-trace-view-correlations.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using correlations for a trace&#34;width=&#34;1400&#34;height=&#34;1170&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/tempo/screenshot-trace-view-correlations.png&#34;
            alt=&#34;Using correlations for a trace&#34;width=&#34;1400&#34;height=&#34;1170&#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;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;To use trace correlations, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Grafana 12 or later&lt;/li&gt;
&lt;li&gt;A 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Tempo data source&lt;/a&gt; configured in Grafana&lt;/li&gt;
&lt;li&gt;Admin access to configuration settings or provisioning files in Grafana&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;set-up-a-trace-correlation&#34;&gt;Set up a trace correlation&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log in to Grafana with an administrator account.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;Configuration&lt;/strong&gt; &amp;gt; &lt;strong&gt;Plugins &amp;amp; data&lt;/strong&gt; &amp;gt; &lt;strong&gt;Correlations&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Add correlation&lt;/strong&gt; or &lt;strong&gt;Add new&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 1, provide a &lt;strong&gt;label&lt;/strong&gt; for the correlation, and an optional &lt;strong&gt;description&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 2, configure the correlation &lt;strong&gt;target&lt;/strong&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Type&lt;/strong&gt; drop-down list and choose &lt;strong&gt;Query&lt;/strong&gt; to link to another data source or choose &lt;strong&gt;External&lt;/strong&gt; for a custom URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For a query &lt;strong&gt;Target&lt;/strong&gt;, select the target drop-down list and select the data source that should be queried when the link is clicked. Define the target query.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For an external &lt;strong&gt;Target&lt;/strong&gt;, enter the &lt;strong&gt;External URL&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For both query and external targets, you can use the following variables based on trace data. Object variables must be parsed into a value variable with a regular expression transformation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&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&lt;/th&gt;
              &lt;th&gt;Type&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;code&gt;traceId&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;String&lt;/td&gt;
              &lt;td&gt;Trace identifier&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;spanID&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;String&lt;/td&gt;
              &lt;td&gt;Span identifier&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;parentSpanID&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;String&lt;/td&gt;
              &lt;td&gt;Parent span identifier&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;serviceName&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;String&lt;/td&gt;
              &lt;td&gt;Service name&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;serviceTags&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Object&lt;/td&gt;
              &lt;td&gt;Resource attributes&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Object&lt;/td&gt;
              &lt;td&gt;Span attributes&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;logs&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Object&lt;/td&gt;
              &lt;td&gt;Trace events&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;references&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Object&lt;/td&gt;
              &lt;td&gt;Trace links&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: 900px;&#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/tempo/screenshot-grafana-trace-correlations-loki-step-2.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/tempo/screenshot-grafana-trace-correlations-loki-step-2.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Setting up a correlation for a Loki target using trace variables&#34;width=&#34;1824&#34;height=&#34;1226&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-2.png&#34;
               alt=&#34;Setting up a correlation for a Loki target using trace variables&#34;width=&#34;1824&#34;height=&#34;1226&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 3, configure the correlation data source:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select your Tempo data source in the &lt;strong&gt;Source&lt;/strong&gt; drop-down list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the trace data variable you use for the correlation in the &lt;strong&gt;Results field&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optionally, add one or more &lt;strong&gt;Transformations&lt;/strong&gt; to parse the trace data into additional variables. You can use these variables to configure the correlation &lt;strong&gt;Target&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 900px;&#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/tempo/screenshot-grafana-trace-correlations-loki-step-3.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/tempo/screenshot-grafana-trace-correlations-loki-step-3.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Setting up a correlation for a Loki data source&#34;width=&#34;1826&#34;height=&#34;1060&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/tempo/screenshot-grafana-trace-correlations-loki-step-3.png&#34;
               alt=&#34;Setting up a correlation for a Loki data source&#34;width=&#34;1826&#34;height=&#34;1060&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Save&lt;/strong&gt; to save the correlation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;verifying-correlations-in-explore&#34;&gt;Verifying correlations in Explore&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open &lt;strong&gt;Explore&lt;/strong&gt; and select your Tempo tracing source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run a query to load spans.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hover over the span links menu or open the span details to reveal the correlation link buttons.&lt;/p&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 900px;&#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/tempo/screenshot-grafana-trace-view-correlations.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/tempo/screenshot-grafana-trace-view-correlations.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-view-correlations.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using correlations for a trace&#34;width=&#34;1400&#34;height=&#34;1170&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations.png&#34;
               alt=&#34;Using correlations for a trace&#34;width=&#34;1400&#34;height=&#34;1170&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click a correlation link to open a split view or navigate to your target system or query.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Below are several practical correlation configurations to get you started.&lt;/p&gt;
&lt;h3 id=&#34;example-1-trace-to-logs-by-service-name-and-trace-identifier&#34;&gt;Example 1: Trace to logs by service name and trace identifier&lt;/h3&gt;
&lt;p&gt;In this example, you configure trace to logs by service name and a trace identifier.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On step 1, add a new correlation with the label &lt;strong&gt;Logs for this service and trace&lt;/strong&gt; and an optional description.&lt;/p&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 900px;&#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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using correlations for a trace&#34;width=&#34;1812&#34;height=&#34;562&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-1.png&#34;
               alt=&#34;Using correlations for a trace&#34;width=&#34;1812&#34;height=&#34;562&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 2, configure the correlation target:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select the target type &lt;strong&gt;Query&lt;/strong&gt; and select your Loki data source as &lt;strong&gt;Target&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Define the Loki query, using &lt;code&gt;serviceName&lt;/code&gt; and &lt;code&gt;traceID&lt;/code&gt; as variables derived from the span data:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{service_name=&amp;#34;$serviceName&amp;#34;} | trace_id=`$traceID` |= ``&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this query, &lt;code&gt;service_name&lt;/code&gt; is the only &lt;a href=&#34;/docs/loki/latest/get-started/labels/&#34;&gt;stream label&lt;/a&gt; used inside &lt;code&gt;{}&lt;/code&gt;. Stream labels should be low-cardinality values that describe the source of your logs.
The &lt;code&gt;trace_id&lt;/code&gt; field appears after the &lt;code&gt;|&lt;/code&gt; pipe as a &lt;a href=&#34;/docs/loki/latest/query/log_queries/#line-filter-expression&#34;&gt;pipeline filter&lt;/a&gt;, which searches log content or &lt;a href=&#34;/docs/loki/latest/get-started/labels/structured-metadata/&#34;&gt;structured metadata&lt;/a&gt; without creating additional streams.
Don&amp;rsquo;t use trace IDs or other high-cardinality values as stream labels because each unique value creates a separate stream, which degrades Loki performance.
For more information, refer to &lt;a href=&#34;/docs/loki/latest/get-started/labels/bp-labels/&#34;&gt;Label best practices&lt;/a&gt; and &lt;a href=&#34;/docs/loki/latest/get-started/labels/cardinality/&#34;&gt;Cardinality&lt;/a&gt;.&lt;/p&gt;
&lt;figure
         class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
         style=&#34;max-width: 900px;&#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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using correlations for a trace&#34;width=&#34;1816&#34;height=&#34;1370&#34;/&gt;
             &lt;noscript&gt;
               &lt;img
                 src=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-2.png&#34;
                 alt=&#34;Using correlations for a trace&#34;width=&#34;1816&#34;height=&#34;1370&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
             &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 3, configure the correlation source:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select your Tempo data source as &lt;strong&gt;Source&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use &lt;code&gt;traceID&lt;/code&gt; as &lt;strong&gt;Results field&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add a new transformation to extract the &lt;code&gt;serviceName&lt;/code&gt; from the span &lt;code&gt;serviceTags&lt;/code&gt; using the regular expression:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{(?=[^\}]*\bkey&amp;#34;:&amp;#34;service.name&amp;#34;)[^\}]*\bvalue&amp;#34;:&amp;#34;(.*?)&amp;#34;.*}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 900px;&#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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.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/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png&#34;data-srcset=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=320 320w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=550 550w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=750 750w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=900 900w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=1040 1040w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=1240 1240w, /media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using correlations for a trace&#34;width=&#34;1812&#34;height=&#34;1050&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/tempo/screenshot-grafana-trace-view-correlations-example-1-step-3.png&#34;
               alt=&#34;Using correlations for a trace&#34;width=&#34;1812&#34;height=&#34;1050&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the correlation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;example-2-trace-to-custom-url&#34;&gt;Example 2: Trace to custom URL&lt;/h3&gt;
&lt;p&gt;In this example, you configure trace correlations with a custom URL.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On step 1, add a new correlation with the label &lt;strong&gt;Open custom URL&lt;/strong&gt; and an optional description.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 2, configure the correlation target:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select the target type &lt;strong&gt;External&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Define your target URL, using variables derived from the span data. In this example, we are using &lt;code&gt;serviceName&lt;/code&gt; and &lt;code&gt;traceID&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;https://my-server.example.com/service=$serviceName&amp;amp;trace=$traceID&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On step 3, configure the correlation source:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Select your Tempo data source as &lt;strong&gt;Source&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use &lt;code&gt;traceID&lt;/code&gt; as &lt;strong&gt;Results field&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add a new transformation to extract the &lt;code&gt;serviceName&lt;/code&gt; from the span &lt;code&gt;serviceTags&lt;/code&gt; using the regular expression:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{(?=[^\}]*\bkey&amp;#34;:&amp;#34;service.name&amp;#34;)[^\}]*\bvalue&amp;#34;:&amp;#34;(.*?)&amp;#34;.*}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the correlation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Name clearly:&lt;/strong&gt; Use descriptive names indicating source and target. For example: &lt;strong&gt;Trace to errors in logs&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use low-cardinality stream labels:&lt;/strong&gt; When targeting Loki, use only low-cardinality values like &lt;code&gt;service_name&lt;/code&gt;, &lt;code&gt;namespace&lt;/code&gt;, or &lt;code&gt;cluster&lt;/code&gt; inside the stream selector &lt;code&gt;{}&lt;/code&gt;. Place high-cardinality values like trace IDs in &lt;a href=&#34;/docs/loki/latest/query/log_queries/#line-filter-expression&#34;&gt;pipeline filters&lt;/a&gt; (after &lt;code&gt;|&lt;/code&gt;) or store them as &lt;a href=&#34;/docs/loki/latest/get-started/labels/structured-metadata/&#34;&gt;structured metadata&lt;/a&gt;. Using trace IDs as stream labels creates excessive streams and degrades Loki performance. For more information, refer to &lt;a href=&#34;/docs/loki/latest/get-started/labels/cardinality/&#34;&gt;Cardinality&lt;/a&gt; and &lt;a href=&#34;/docs/loki/latest/get-started/labels/bp-labels/&#34;&gt;Label best practices&lt;/a&gt;. For detailed guidance on mapping span attributes to Loki labels, refer to 
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Template wisely:&lt;/strong&gt; Use multiple &lt;code&gt;$variable&lt;/code&gt; tokens if you need to inject more than one field.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-logs/&#34;&gt;Configure trace to logs correlation&lt;/a&gt;: Link spans to log queries in Loki with tag mapping and cardinality guidance.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-metrics/&#34;&gt;Configure trace to metrics correlation&lt;/a&gt;: Link spans to metrics queries in Prometheus.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/configure-trace-to-profiles/&#34;&gt;Configure trace to profiles correlation&lt;/a&gt;: Link spans to profiling data in Grafana Pyroscope.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v13.0/datasources/tempo/configure-tempo-data-source/&#34;&gt;Configure the Tempo data source&lt;/a&gt;: Return to connection, authentication, and streaming settings.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="trace-correlations">Trace correlations&lt;/h1>
&lt;p>You can use Grafana
&lt;a href="/docs/grafana/v13.0/administration/correlations/">correlations&lt;/a> to embed interactive correlation links in your trace view to jump from spans to related logs, metrics, profiles, or external systems. This guide explains how to configure and manage Trace correlations in Grafana.&lt;/p></description></item></channel></rss>