Sentry query editor
This document explains how to use the Sentry query editor to build queries and visualize Sentry data in Grafana dashboards.
Before you begin
- Configure the Sentry data source.
- Verify your Sentry authentication token has the required read permissions.
Common fields
Every query type includes the following shared fields.
Query types
The query editor supports seven query types, each returning a different kind of Sentry data.
Issues
Use the Issues query type to retrieve a list of Sentry issues. Results are filtered based on the dashboard time range.
Issue query examples
is:unresolved– Show only unresolved issues.is:unresolved assigned:me– Show unresolved issues assigned to you.is:unresolved level:error– Show unresolved error-level issues.is:unresolved first-seen:-24h– Show unresolved issues first seen in the last 24 hours.is:unresolved times_seen:>100– Show unresolved issues seen more than 100 times.
For more information about Sentry issues, refer to the Sentry Issues documentation.
Events
Use the Events query type to retrieve a list of Sentry events. Results are filtered based on the dashboard time range.
Event query examples
event.type:error– Show only error events.event.type:error level:fatal– Show fatal error events.event.type:transaction transaction.duration:>5000– Show transactions slower than 5 seconds.release:1.2.0– Show events from a specific release.tags[browser]:Chrome– Show events from Chrome browsers.
For more information about Sentry events, refer to the Sentry Discover documentation.
Spans
Use the Spans query type to retrieve span data from Sentry. This query type uses the same editor as Events but queries the Sentry spans API and provides span-specific field suggestions.
Span query examples
span.op:db– Show database spans.span.op:http.client span.description:*api*– Show HTTP client spans with “api” in the description.
Events Stats
Use the Events Stats query type to retrieve time-series data for Sentry events, suitable for graphing trends over time. Results are filtered based on the dashboard time range.
Events Stats use cases
- Error trend monitoring: Set Y-axis to
count()and Query toevent.type:errorto graph error volume over time. - Error rate by release: Set Y-axis to
count(), Query toevent.type:error, and Group toreleaseto compare error rates across releases. - Transaction performance: Set Y-axis to
p95(transaction.duration)to track the 95th percentile response time.
Spans Stats
Use the Spans Stats query type to retrieve time-series data for Sentry spans. This query type uses the same editor as Events Stats but queries the Sentry spans stats API.
Spans Stats use cases
- Database performance: Set Y-axis to
p95(span.duration)and Query tospan.op:dbto track database query performance. - Slow HTTP calls by endpoint: Set Y-axis to
avg(span.duration), Query tospan.op:http.client, and Group tospan.descriptionto identify slow external calls.
Metrics
Use the Metrics query type to retrieve session-based metrics from Sentry, such as crash rates, error rates, and session counts.
Metrics use cases
- Crash-free rate monitoring: Set Field to
session.crash_free_rateand Group By toreleaseto compare stability across releases. - Session health by environment: Set Field to
session.healthyand Group By toenvironmentto compare session health across staging and production. - ANR rate tracking: Set Field to
session.anr_rateto monitor Application Not Responding rates on mobile apps.
Stats
Use the Stats query type to retrieve organization-level usage statistics from Sentry, such as event counts and quotas. Results are filtered based on the dashboard time range. The Environments filter is not available for this query type.
Stats use cases
- Error quota monitoring: Set Field to
sum(quantity), Category Filter toerror, and Group By tooutcometo track how many errors are accepted, filtered, or rate-limited. - Event consumption by project: Set Field to
sum(quantity), Category Filter toerror, and filter by specific projects to understand per-project quota usage. - Dropped event tracking: Set Field to
sum(quantity), Category Filter toerror, and Outcome Filter torate_limitedandclient_discardto monitor events your organization is losing.
For more information about organization statistics, refer to the Sentry Org Stats documentation.


