---
title: "Write TraceQL query | Grafana Labs"
description: "Learn how to write a TraceQL query to visualize traces on a panel"
---

# 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, complete the following steps:

1. 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.
2. 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}`
3. Click **Refresh** to update the list of traces in the table.
4. On the right of the page, under **Panel options**, enter a panel **Title** and description.
   
   The title appears at the top of the panel.
5. Click **Save** located in the upper-right corner of the page.
6. Enter a title and description for your dashboard, and select a folder, if applicable.
7. Click **Save** to save the dashboard.
8. 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

- [TraceQL](/docs/tempo/latest/traceql/#construct-a-traceql-query)
- [Investigate traces using Search query builder](/docs/grafana-cloud/connect-externally-hosted/data-sources/tempo/query-editor/traceql-search/)
- [Query tracing data](/docs/grafana-cloud/send-data/traces/traces-query-editor/)
