Write TraceQL query
TraceQL is a query language designed for searching and filtering traces within Grafana Cloud. It enables you to write expressions that specify criteria to locate specific traces. A basic TraceQL query consists of key-value pairs that filter traces, ensuring only those matching the defined criteria are included in the results.
In this milestone, you’ll write a TraceQL query using the Search query builder that visualizes a list of traces in a table.
In the Query Builder, click the Search tab located to the right of Query type.
The traces table populates with a list of traces and a list of search criteria appears.
For any of the search criteria, select an operator and a value.
For example, when:
- Service Name =
app-2048 - Span Name =
POST / - Status =
Error
The resulting TraceQL query is:
{resource.service.name="app-2048" && name="POST /" && status=error}- Service Name =
- Click Refresh to update the list of traces in the table.
- Click Save located in the upper-right corner of the page.
- Enter a title and description for your dashboard, and select a folder, if applicable.
- Click Save to save the dashboard.
- Click Back to dashboard.
- Did you know? If you’re using Grafana Enterprise or Grafana Cloud, you can save queries for reuse across panels and dashboards. Click Save query to save your current query, or use the Saved queries drop-down menu to reuse a previously saved query.
In the next milestone you’ll add a dashboard variable.
More to explore (optional)
At this point in your journey, you can explore the following paths:
At this point in your journey, you can explore the following paths:
