Grafana Cloud Enterprise Open source
Last reviewed: August 11, 2026

Zipkin template variables

Use template variables to create dynamic, reusable dashboards. Instead of hard-coding trace IDs, you can use variables to let dashboard viewers select or input trace IDs at view time, making it easier to share dashboards across teams.

For an introduction to Grafana template variables, refer to Variables.

Supported variable types

Variable typeDescriptionSupported
CustomDefine a fixed list of trace IDs or other values.Yes
Text boxLet users type a trace ID at dashboard view time.Yes
Data sourceLet users switch between Zipkin instances.Yes
QueryPopulate options from a data source query.No

The Zipkin data source doesn’t support query-based variables, but you can use custom or text box variables to parameterize trace ID queries.

Create a text box variable

A text box variable lets dashboard viewers enter a trace ID directly. This is the most common variable type for Zipkin.

To create a text box variable:

  1. Navigate to the dashboard you want to update.
  2. Select Editing in the dashboard mode drop-down list.
  3. Click the Add new element icon (blue plus sign).
  4. Click Variable.
  5. Select Textbox as the variable type.
  6. Set the Name to traceId.
  7. Select an option in the Display drop-down list to control where on the dashboard the variable is displayed.
  8. (Optional) Set a default Value with a known trace ID for initial display.
  9. Click Save.
  10. (Optional) Enter a description of the changes you’ve made.
  11. Click Save.
  12. Select Viewing in the dashboard mode drop-down list.

The dashboard displays a text input where viewers can paste a trace ID.

Create a custom variable

A custom variable provides a predefined list of values. This is useful when you want to give viewers a set of known trace IDs to choose from.

To create a custom variable:

  1. Navigate to the dashboard you want to update.

  2. Select Editing in the dashboard mode drop-down list.

  3. Click the Add new element icon (blue plus sign).

  4. Click Variable.

  5. Select Custom as the variable type.

  6. Set the Name to traceId.

  7. Select an option in the Display drop-down list to control where on the dashboard the variable is displayed.

  8. Click Open variable editor to open the Custom options dialog box.

  9. Enter trace IDs in the Values separated by comma field:

    efe9cb8857f68c8f,463ac35c9f6413ad48485a3953bb6124
  10. Click Apply.

  11. Click Save.

  12. (Optional) Enter a description of the changes you’ve made.

  13. Click Save.

  14. Select Viewing in the dashboard mode drop-down list.

The dashboard displays a drop-down where viewers can select from the predefined trace IDs.

Create a data source variable

A data source variable lets viewers switch between multiple Zipkin instances. This is useful when you have separate Zipkin deployments for different environments.

To create a data source variable:

  1. Navigate to the dashboard you want to update.
  2. Select Editing in the dashboard mode drop-down list.
  3. Click the Add new element icon (blue plus sign).
  4. Click Variable.
  5. Select Data source as the variable type.
  6. Set the Name to zipkinDs.
  7. Select an option in the Display drop-down list to control where on the dashboard the variable is displayed.
  8. Select Zipkin as the Type.
  9. Click Save.
  10. (Optional) Enter a description of the changes you’ve made.
  11. Click Save.
  12. Select Viewing in the dashboard mode drop-down list.

Then, in your panel’s query editor, select ${zipkinDs} as the data source instead of a specific Zipkin instance.

Use variables in queries

You can use template variables in the Trace ID field of the query editor. Grafana replaces the variable with its current value when the query runs.

For example, if you create a text box variable named traceId, enter ${traceId} in the trace ID field. When the viewer enters a new trace ID, the query automatically runs with the new value.

For more information about variable syntax, refer to Variable syntax.

Troubleshoot template variable issues

If template variables aren’t working as expected, refer to Troubleshoot Zipkin data source issues.