Configuring Tempo Data Source
1. Setting Tempo URL and Authentication
| Property | Value | Description |
|---|---|---|
| url | http://tempo:3200 |
URL of the Tempo server |
| auth | basic |
Authentication method (e.g., basic, bearer) |
| username | admin |
Username for basic auth |
| password | secret |
Password for basic auth |
Example: Grafana Tempo Data Source Configuration
{
"name": "Tempo",
"type": "tempo",
"url": "http://tempo:3200",
"access": "proxy",
"basicAuth": true,
"basicAuthUser": "admin",
"basicAuthPassword": "secret"
}
2. Configuring Trace to Logs
| Property | Value | Description |
|---|---|---|
| datasource.uid | tempo-ds |
Unique identifier for the Tempo data source in Grafana |
| datasource.name | Tempo |
Name of the data source as shown in Grafana UI |
| datasource.type | tempo |
Indicates the data source type for Tempo |
| datasource.access | proxy |
Access mode for the data source (proxy or direct) |
| datasource.jsonData | {} |
Configuration options specific to Tempo data source |
Example: Tempo Data Source Configuration
{
"name": "Tempo",
"type": "tempo",
"uid": "tempo-ds",
"access": "proxy",
"jsonData": {
"server": "http://tempo:3200"
}
}
Note: Ensure that the Tempo server URL is accessible from Grafana's network.
Warning: Misconfigured trace-to-logs mapping can lead to incorrect log retrieval.
3. Setting Trace to Metrics
| Property | Description | Default Value | Notes |
|---|---|---|---|
| traceToMetrics | Enables or disables the trace-to-metrics conversion feature in Tempo. | false |
When enabled, Tempo will convert trace data into metrics for visualization in Grafana. |
| traceToMetrics.mapping | Defines the mapping rules for converting trace data to metrics. | null |
Must be configured with a valid mapping configuration to enable conversion. |
| traceToMetrics.metrics | List of metric names to generate from trace data. | [] |
Each metric name must be unique and follow Grafana naming conventions. |
Example: Enabling Trace to Metrics in Tempo Configuration
traceToMetrics:
enabled: true
mapping:
service:
name: "service_name"
tags:
- "http.method"
- "http.status_code"
metrics:
- name: "request_count"
query: "sum by (service_name) (rate(http_requests_total[5m]))"
Note: The
traceToMetrics feature requires Tempo v2.0 or later and Grafana v9.0 or later for full support.
4. Configuring Service Graph
| Property | Value | Description |
|---|---|---|
| serviceGraph | true |
Enables service graph visualization in Grafana |
| serviceGraph.datasource | tempo-datasource |
Name of the Tempo data source to use for service graph |
| serviceGraph.refreshInterval | 30s |
How often to refresh the service graph data |
Example: Service Graph Configuration
{
"serviceGraph": {
"datasource": "tempo-datasource",
"refreshInterval": "30s"
}
}
Note: Service graph requires Tempo to be configured as a data source and the
tempo-datasource must be accessible from Grafana.
5. Setting Search Tab Options
| Option | Values | Description |
|---|---|---|
| tempo.search.maxDuration | 1d |
Maximum duration for search queries |
| tempo.search.maxTraceIDLength | 64 |
Maximum length of trace IDs to display |
| tempo.search.showTraceID | true |
Whether to show trace IDs in search results |
| tempo.search.showServiceGraph | false |
Whether to show service graph in search results |
| tempo.search.showTraceList | true |
Whether to show trace list in search results |
Example: Tempo Search Configuration
{
"tempo": {
"search": {
"maxDuration": "1d",
"maxTraceIDLength": 64,
"showTraceID": true,
"showServiceGraph": false,
"showTraceList": true
}
}
}
6. Configuring Span Bar Options
| Option | Values | Description |
|---|---|---|
| tempo.spanBar.enabled | true | false |
Enable or disable the span bar visualization in Tempo data source. |
| tempo.spanBar.color | #007bff | #28a745 | #ffc107 |
Color of the span bar in the trace view. |
| tempo.spanBar.height | 20px | 30px |
Height of the span bar in pixels. |
| tempo.spanBar.showLabels | true | false |
Whether to show labels on the span bar. |
Example: Tempo Span Bar Configuration
{
"tempo": {
"spanBar": {
"enabled": true,
"color": "#007bff",
"height": "20px",
"showLabels": false
}
}
}
7. Setting Node Graph Options
| Option | Values | Description |
|---|---|---|
| nodeGraph | true | false |
Enable or disable the node graph view in Tempo data source. |
| nodeGraph.showMetrics | true | false |
Display metrics on nodes in the graph. |
| nodeGraph.showTraceDetails | true | false |
Show detailed trace information when clicking on a node. |
| nodeGraph.linkStyle | bezier | straight | orthogonal |
Style of links between nodes in the graph. |
Example: Node Graph Configuration
{
"name": "Tempo",
"type": "tempo",
"jsonData": {
"nodeGraph": true,
"nodeGraph.showMetrics": true,
"nodeGraph.showTraceDetails": false,
"nodeGraph.linkStyle": "bezier"
}
}
8. Configuring Trace Streaming
| Property | Value | Description |
|---|---|---|
| tempo.datasource.url | http://localhost:3200 |
URL of the Tempo data source instance |
| tempo.datasource.name | Tempo |
Name of the data source in Grafana |
| tempo.datasource.type | tempo |
Type identifier for Tempo data source |
Example: Tempo Data Source Configuration
{
"name": "Tempo",
"type": "tempo",
"url": "http://localhost:3200",
"access": "proxy"
}
Note: Ensure that the Tempo instance is accessible from Grafana's network and that required authentication settings are configured if needed.
9. Setting Exemplar Integration
| Property | Value | Description |
|---|---|---|
| exemplar | true |
Enables exemplar support for Tempo data source |
| exemplar.query | query |
Query string to fetch exemplars from Tempo |
Example: Enable Exemplar Integration in Grafana
datasources:
- name: Tempo
type: tempo
uid: tempo-datasource
exemplar:
enabled: true
query: "exemplar_query"
10. Testing Tempo Connection
Example: Test Tempo Data Source Connection
curl -X GET \
"http://grafana-server:3000/api/datasources/uid/tempo-datasource" \
-H "Authorization: Bearer <your-api-token>"
| Field | Description | Value |
|---|---|---|
| uid | Unique identifier for the Tempo data source | tempo-datasource |
| name | Name of the data source as configured in Grafana | Tempo |
| type | Indicates the type of data source (e.g., Tempo) | tempo |
| url | Endpoint URL for the Tempo instance | http://tempo-server:3200 |
Note: Ensure the Tempo server is accessible from the Grafana instance and that required authentication headers are correctly set.