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.
To write a TraceQL query, perform the following steps.
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.
On the right of the page, under Panel options, enter a panel Title and description.
The title appears at the top of the panel.
Click Save dashboard located in the upper-right of the page, enter a title and description, and select a folder, if applicable.
Click Save.
On the top toolbar, click Back to dashboard.
In the next milestone you’ll add a dashboard variable.
At this point in your journey, you can explore the following paths: