Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Configure the Tempo data source
To configure basic settings for the Tempo data source, complete the following steps:
Click Connections in the left-side menu.
Under Your connections, click Data sources.
Enter
Tempo
in the search bar.Select Tempo.
On the Settings tab, set the data source’s basic configuration options:
You can also configure settings specific to the Tempo data source.
This video explains how to add data sources, including Loki, Tempo, and Mimir, to Grafana and Grafana Cloud. Tempo data source set up starts at 4:58 in the video.

Trace to logs
The Trace to logs setting configures the trace to logs feature that is available when you integrate Grafana with Tempo.
There are two ways to configure the trace to logs feature:
- Use a simplified configuration with default query, or
- Configure a custom query where you can use a template language to interpolate variables from the trace or span.
Use a simple configuration
Select the target data source from the drop-down list.
You can also click Open advanced data source picker to see more options, including adding a data source.
Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in trace it may be necessary to search in larger or shifted time range to find the desired logs.
Select which tags to use in the logs query. The tags you configure must be present in the span’s attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful, for example, if the tag has dots in the name and the target data source does not allow using dots in labels. In that case, you can for example remap
http.status
(the span attribute) tohttp_status
(the data source field). “Data source” in this context can refer to Loki, or another log data source.Optionally switch on the Filter by trace ID and/or Filter by span ID setting to further filter the logs if your logs consistently contain trace or span IDs.
Configure a custom query
Select the target data source from the drop-down list.
You can also click Open advanced data source picker to see more options, including adding a data source.
Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in the trace it may be necessary to widen or shift the time range to find the desired logs.
Optional: Select tags to map. These tags can be used in the custom query with
${__tags}
variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source. Only the tags that were present in the span are included; tags that aren’t present are omitted You can also configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn’t allow dots in labels. For example, you can remaphttp.status
tohttp_status
. If you don’t map any tags here, you can still use any tag in the query, for example,method="${__span.tags.method}"
. You can learn more about custom query variables here.Skip Filter by trace ID and Filter by span ID settings as these cannot be used with a custom query.
Switch on Use custom query.
Specify a custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating an invalid query.
Configure trace to logs
The following table describes the ways in which you can configure your trace to logs settings:
Trace to metrics
Note
This feature is behind the
traceToMetrics
feature toggle. If you use Grafana Cloud, open a support ticket in the Cloud Portal to access this feature.
The Trace to metrics setting configures the trace to metrics feature available when integrating Grafana with Tempo.

There are two ways to configure the trace to metrics feature:
- Use a basic configuration with a default query, or
- Configure one or more custom queries where you can use a template language to interpolate variables from the trace or span.
Simple config
To use a simple configuration, follow these steps:
Select a metrics data source from the Data source drop-down.
Optional: Choose any tags to use in the query. If left blank, the default values of
cluster
,hostname
,namespace
,pod
,service.name
andservice.namespace
are used.The tags you configure must be present in the spans attributes or resources for a trace to metrics span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source doesn’t allow using dots in labels. In that case you can for example remap
service.name
toservice_name
.Do not select Add query.
Select Save and Test.
Custom queries
To use custom queriess with the configuration, follow these steps:
Select a metrics data source from the Data source drop-down.
Optional: Choose any tags to use in the query. If left blank, the default values of
cluster
,hostname
,namespace
,pod
,service.name
andservice.namespace
are used.These tags can be used in the custom query with
${__tags}
variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren’t present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn’t allow using dots in labels. For example, you can remapservice.name
toservice_name
in such a case. If you don’t map any tags here, you can still use any tag in the query like thismethod="${__span.tags.method}"
. You can learn more about custom query variables here.Click Add query to add a custom query.
Specify a custom query to be used to query metrics data.
Each linked query consists of:
- Link Label: (Optional) Descriptive label for the linked query.
- Query: The query ran when navigating from a trace to the metrics data source.
Interpolate tags using the
$__tags
keyword. For example, when you configure the queryrequests_total{$__tags}
with the tagsk8s.pod=pod
andcluster
, the result looks likerequests_total{pod="nginx-554b9", cluster="us-east-1"}
.
Select Save and Test.
Configure trace to metrics
Trace to profiles
Using Trace to profiles, you can use Grafana’s ability to correlate different signals by adding the functionality to link between traces and profiles.
Trace to profiles 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.

There are two ways to configure the trace to profiles feature:
- Use a basic configuration with default query, or
- Configure a custom query where you can use a template language to interpolate variables from the trace or span.
Note
Traces to profile requires a Tempo data source with Traces to profiles configured and a Pyroscope data source.
As with traces, your application needs to be instrumented to emit profiling data. For more information, refer to Linking tracing and profiling with span profiles.
To use trace to profiles, navigate to Explore and query a trace. 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 + 60 seconds).
To use trace to profiles, you must have a configured Grafana Pyroscope data source. For more information, refer to the Grafana Pyroscope data source documentation.
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. Hover over a particular block in the flame graph to see more details about the consumed resources.
Configuration options
The following table describes options for configuring your Trace to profiles settings:
Use a basic configuration
To use a basic configuration, follow these steps:
Select a Pyroscope data source from the Data source drop-down.
Optional: Choose any tags to use in the query. If left blank, the default values of
service.name
andservice.namespace
are used.The tags you configure must be present in the spans attributes or resources for a trace-to-profiles 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’t allow dots in labels. In that case, you can remap
service.name
toservice_name
.Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.
The profile type or app must be selected for the query to be valid. Grafana doesn’t show any data if the profile type or app isn’t selected when a query runs.
Do not select Use custom query.
Select Save and Test.
If you have configured a Pyroscope data source and no profile data is available or the Profiles for this span button and the embedded flame graph is not visible, verify that the pyroscope.profile.id
key-value pair exists in your span tags.
Configure a custom query
To use a custom query with the configuration, follow these steps:
Select a Pyroscope data source from the Data source drop-down.
Optional: Choose any tags to use in the query. If left blank, the default values of
service.name
andservice.namespace
are used.These tags can be used in the custom query with
${__tags}
variable. This variable interpolates the mapped tags as list in an appropriate syntax for the data source. Only the tags that were present in the span are included; tags that aren’t present are omitted. You can also configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source doesn’t allow using dots in labels. For example, you can remapservice.name
toservice_name
. If you don’t map any tags here, you can still use any tag in the query, for example:method="${__span.tags.method}"
. You can learn more about custom query variables here.Select one or more profile types to use in the query. Select the drop-down and choose options from the menu.
Switch on Use custom query to enter a custom query.
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 is shown 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
$__tags
keyword.Select Save and Test.
Configure trace to profiles
The following table describes options for configuring your trace to profiles settings:
Custom query variables
To use a variable in your trace to logs, metrics or profiles you need to wrap it in ${}
. For example, ${__span.name}
.
Service Graph
The Service Graph setting configures the Service Graph feature.
Configure the Data source setting to define in which Prometheus instance the Service Graph data is stored.
To use the Service Graph, refer to the Service Graph documentation.
Node Graph
The Node Graph setting enables the node graph visualization, which is disabled by default.
Once enabled, Grafana displays the node graph above the trace view.
Tempo search
The Search setting configures Tempo search.
You can configure the Hide search setting to hide the search query option in Explore if search is not configured in the Tempo instance.
Loki search
The Loki search setting configures the Loki search query type.
Configure the Data source setting to define which Loki instance you want to use to search traces. You must configure derived fields in the Loki instance.
TraceID query
The TraceID query setting modifies how TraceID queries are run. The time range can be used when there are performance issues or timeouts since it will narrow down the search to the defined range. This setting is disabled by default.
You can configure this setting as follows:
Span bar
The Span bar setting helps you display additional information in the span bar row.
You can choose one of three options:
Provision the data source
You can define and configure the Tempo data source in YAML files as part of Grafana’s provisioning system. For more information about provisioning and available configuration options, refer to Provisioning Grafana.
Example provision YAML file: