A series of

  • 1 minute Quick use of The latest version of Docker Sentry-CLI – create version
  • Quick use of Docker start Sentry-CLI – 30 seconds start Source Maps
  • Sentry For React
  • Sentry For Vue
  • Sentry-CLI usage details
  • Sentry Web Performance Monitoring – Web Vitals
  • Sentry Web performance monitoring – Metrics
  • Sentry Web Performance Monitoring – Trends
  • Sentry Web Front-end Monitoring – Best Practices (Official Tutorial)
  • Sentry Backend Monitoring – Best Practices (Official Tutorial)

directory

  • Discover the query
    • Preset query
    • Saved query
      • Building a new query
      • A search query
      • Sorting query
      • Edit the query
      • Share the query
      • Delete query
    • The query results
    • Event details
  • Query generator
    • Filter by globally selected title
    • Filter by search criteria
      • grammar
      • Tag the Summary filter
    • Filter by interactive chart
      • Display options
      • Y options
    • Filter by table
      • Overlay function
      • Cell filtering
      • Additive equation
      • Row of the sequence
    • Other Query operations
      • Edit the query
      • Share the query
      • Export CSV
      • Delete query
    • Add query equation
      • Additive equation
      • Equation guide
      • Example equation
        • Calculate the percentage of completed transactions
        • Calculate the user-defined Apdex
        • Find the maximum average non-database time
  • Discover trends with Discover
    • Through the Issues Discover
    • Through the Errors Discover
      • URL error
      • Unhandled error
      • The file with the most errors
      • Errors per Release
      • Error in calculating by hour or by day
    • Other use cases

Discover the query

Discover provides visibility into your data across environments by building and enriching your error data. You can query and unlock insights into the health of the entire system and get answers to key business questions in one place.

The Discover home page provides a view of all saved and pre-built queries, so you can quickly drill down to areas that need immediate attention. For example, if there is a spike in error queries in the last 24 hours, the user can investigate first. Each query is saved as a card that shows a summary view of the data.

  • The display name
  • The search criteria
  • The creator
  • The chart snapshot
  • Date range
  • The last edit

Preset query

Query cards with Sentry ICONS are pre-built and cannot be removed.

  • All Events: Users can view the raw error stream for any project team. This replaces the event function, enabling the user to add additional columns and change the grouping to achieve the desired refinement.
  • Errors by Title: Users can view the most common errors by looking at the total number of original errors and the total number of users affected.
  • Errors by URL: The user can see the page that produces the most errors and different types of problems. As a reminder, the problem is a set of fingerprint events. See the complete documentation on fingerprints for more details.
    • Docs. Sentry. IO/product/dat…

Saved query

A query card with the user’s profile picture represents a saved query. Users who create a saved query will have their profile picture displayed on the query card. The saved queries are viewable by anyone in the organization and are not limited to user accounts.

Building a new query

From the Discover home page, you can build queries in three ways.

  • Click on theBuild a new Query
  • Click the ellipsis of an existing saved query card toDuplicate (copy)
  • Enter any existing query
    1. Click on the top rightSave as...
    2. Enter display name
    3. Click on theSave (Save)

Apply new search criteria or table columns to modify query results. Save the query and assign a custom display name. See the documentation on query generators for complete details.

  • Docs. Sentry. IO/product/dis…

A search query

Looking for a specific query? Use the search bar on the home page to find the query name.

Sorting query

A drop-down menu in the upper right corner will allow you to sort by property.

  • Recent editorRecently Edited(the default)
  • I queryMy Queries
  • The name of the queryQuery Name (A-Z)
  • Creation dateDate Created(latest)
  • Creation dateDate Created(the oldest)
  • The most out of dateMost Outdated

Edit the query

If you need to edit any of these queries, go into the query and make the required changes, and a button appears in the upper right corner asking you to save/update the query. Keep in mind that edits to query criteria are not automatically saved.

To rename a saved query, click the pencil icon next to the title and enter the desired display name. Click Enter or click outside the area to save the updated name.

Share the query

Feel free to share your questions. You can share urls with other users who also have access to the same organization. As each part of the query is built, the results and URLS are updated so that ongoing searches can be shared in E-mail, chat, and so on.

Delete query

On the Discover home page, each saved query card has an ellipsis that opens the context menu. From here, you can delete the query. This action is irreversible. You can also delete the Query in the Query Results view by clicking the trash can in the upper right corner.

The query results

To see the query results, click on any query card. You’ll find charts, tables, and switchable label summaries (or facet maps). The search bar at the top lets you see the search criteria you entered. This table represents events that have a sortable sequence.

Each table cell has a dynamic context menu that allows you to continue exploring your data by automatically updating the search bar or table column as you choose. Actions such as adding or excluding values in filters, opening the selected version, or viewing the underlying problem stack:

If the first column displays an icon (as shown above), the event is stacked. Click the icon for a complete list of events. Each event has an event ID, which you can click to learn more about. For more information on how to build queries, go to query Builder.

  • Docs. Sentry. IO/product/dis…

Event details

Navigate to the Event details page from Discover > [Saved Query] > Event Detail. You will find all relevant details about a single event. For each event, you see the ID, timestamp, and link to see the normalized JSON payload received by Sentry.

The Event Detail view varies by Event type (error, transaction, CSP). Transaction event details may have a completely different view from error event details (as shown above). For example, errors might show up in the sidebar. This allows you to quickly browse the volume of events for the issue and lets you quickly navigate to related issues. You can also find stack traces, breadcrumbs, and more in these views.

Query generator

From the Discover home page, you can build queries in three ways.

  • Click on theBuild a new Query
  • Click the ellipsis of an existing saved query card toDuplicate (copy)
  • Enter any existing query
    1. Click on the top rightSave as...
    2. Enter display name
    3. Click on theSave (Save)

There are four main building blocks that affect the results of saved queries. You can use a combination of these methods to narrow your search.

  1. Global Selection Header
  2. Search Conditions
  3. An Interactive Graph
  4. Table Columns

Filter by globally selected title

Specify the projects, Environments, and date range to zoom in on at the top of the page. This can also be found in other parts of the Sentry as a Top level filter.

Filter by search criteria

All events have built-in key fields or custom tags. Use the search bar to enter these keys and assign them values. This will filter your list of events. This is the key fields built in.

General (common) id (string)

issue.id (number)

message (string)

project.id (number)

release (string)

release.package (string)

release.version (string)

release.build (string)

title (string)

platform.name (string)

environment (string)

event.type(string)

location (string)

timestamp (datetime)

timestamp.to_hour (datetime)

timestamp.to_day (datetime)
Device (equipment) device.arch (string)

device.battery_level (number)

device.brand (string)

device.charging (string)

device.locale (string)

device.name (string)

device.online (string)

device.orientation (string)

device.simulator (string)

device.uuid (string)
Geo (geography) geo.city (string)

geo.country_code (string)

geo.region (string)
HTTP http.method (string)

http.url (string)
OS os.build (string)

os.kernel_version (string)
SDK sdk.name (string)

sdk.version (string)
Stack traces error.handled (string)

error.mechanism (string)

error.type (string)

error.value (string)

stack.abs_path (string)

stack.colno (number)

stack.filename (string)

stack.function (string)

stack.in_app (boolean)

stack.lineno (number)

stack.module (string)

stack.package (string)

stack.stack_level (number)
User Attributes user (string)

user.email (string)

user.id (string)

user.ip (string)

user.username (string)

grammar

The query generator syntax is the same as Sentry’s search syntax. After entering key fields or custom tags from above, you can use any referenced syntax. For example, count() gives you the number of times the event occurred. This can be written as follows:

  • A perfect match (equal to) :count():99
  • Upper limit (less than or equal to) :count():<99count():<=99
  • Lower limit (greater than or equal to) :count():>99count():>=99
  • Multiple boundaries (greater than and less than) :count():>10 count():<20

Use OR AND AND search criteria between filters. However, OR cannot be used between aggregate and non-aggregate filters. For more details on these conditions, see Using OR AND.

  • Docs. Sentry. IO/product/sen…

You can also search for multiple values of the same key by placing values in a list. For example, “x:[value1, value2]” will find the same result as “x:value1 OR x:value2”. You can learn more about this in our coverage of multiple values on the same Key.

  • Docs. Sentry. IO/product/sen…

Tag the Summary filter

Each event has a list of tag values. The label Summary facet chart (or facet chart) is a visualization of the top 10 keys sorted by frequency. The most common tag values are listed directly above the description and percentage columns. Hover over each section of the bar to see the exact distribution of the label.

Click on any of these sections to further refine your search. For example, clicking on the part of the browser bar that represents Chrome will automatically update the Tag summary and then add Chrome to the search criteria.

Filter by interactive chart

Each query has an interactive chart that reflects the data displayed in the table below. To zoom in, simply click and drag on the area you want to survey. You can also customize the display and Y axis. This will be saved with your query.

Display options

  • Total Period
  • Previous Period
  • Release Markers
  • Top 5 Period
  • Total Daily
  • Top 5 Daily(every day 5)

Y options

  • Count
  • Average Transaction Duration
  • p75
  • p95
  • Unique User Count

Filter by table

At the top of the table, click Columns to turn on Modal. This displays a list of all the columns in the result table. You can add, remove, and move basic Key Field columns or Custom Tags columns. Using the same view, you can also stack events using any of the following functions:

Overlay function

  • avg(...)
  • count(...)
  • count_unique(...)
  • max(...)
  • min(...)
  • sum(...)

Each function asks you to assign a parameter. Some are required, while others are optional. The function will stack events based on the same values. If no function is applied, the events in the query result are listed separately. After the columns are edited, click Apply. The query results are reflected in the query results. Keep in mind that if you add too many columns, the table may scroll horizontally.

Cell filtering

Each cell in the table appears with an ellipsis as it hovers. This opens a context menu with additional filtering capabilities depending on the value type. For example, you can selectively locate a transaction to the search criteria bar by clicking Add to Filter.

Additive equation

You can also add equations to the query using table columns as equation variables, and the results will be displayed in the query results table. Learn more in adding query equations.

  • Docs. Sentry. IO/product/dis…

Row of the sequence

Click the column header that you want to sort. The down arrow sorts the columns in descending order, and the up arrow sorts the columns in ascending order. This may refresh the table.

Other Query operations

Edit the query

If you need to edit any of these queries, go into the query and make the required changes, and a button appears in the upper right corner asking you to save/update the query. Keep in mind that edits to query criteria are not automatically saved.

To rename a saved query, click the pencil icon next to the title and enter the desired display name. Click “Enter” or click outside the area to confirm.

Share the query

Feel free to share your questions. You can share urls with other users who also have access to the same organization. As each part of the query is built, the results are updated, and the URL is updated so that the ongoing search can be shared in email, chat, and so on.

Export CSV

If you want to take the data elsewhere, click Export to get the CSV file.

For large exports, once you are ready, you will receive an email with a download link. This will require further verification on the Sentry download page. This contains the SHA1 checksum of the file, whose integrity you can verify with the following command:

echo "<SHA1 checksum> <downloaded CSV name>" | sha1sum -c -
Copy the code

The wait time may vary depending on the amount of data. Results are limited to 10 million lines or 1GB, whichever comes first.

Delete query

Deleting a saved query is not reversible.

On the Discover home page, each saved query card has an ellipsis that opens the context menu. Delete the query from here. You can also delete the Query in the Query Results view by clicking the trash can in the upper right corner.

Add query equation

In Discover, you can add equations based on query columns. Each column is like a variable because it represents the numeric result of the query, which is used in the equation.

For example, let’s use an equation to calculate the ratio of the first content rendering of a transaction (measures.fCP) to the largest content rendering of a transaction (measures.lCP) :

equation = measurements.fcp / measurements.lcp

The equation will use the results of each query column to calculate the ratio. In this case, the result of these query columns is:

  • measurements.fcp = 50
  • measurements.lcp = 100

The equation becomes:

50/100

The result of the equation is then displayed in the updated table, as shown in the following record:

These equations help you calculate the following:

  • Done within the thresholdtransactionThe percentage
    • Docs. Sentry. IO/product/dis…
  • Customize Apdex scores
    • Docs. Sentry. IO/product/dis…
  • Maximum average non-database times
    • Docs. Sentry. IO/product/dis…

Additive equation

Add equations to queries

  1. Click on theColumn (Columns)Button to open the column editor.
  2. If they are not already included in your query, add the columns required by the equation.
  3. Click on theAdd an Equation
  4. Enter your equations by selecting columns, entering numbers (if necessary), and adding operators.
  5. Click on the"Application" (Apply).

Equation guide

The equation must:

  • Contains at least one field or function
  • Contains at least one operator
  • There are explicit operators. For example,a(a+b)Invalid; Instead, you should entera * (a + b)

Equations cannot:

  • Contains a mixture of fields and functions
  • Contains unsupported indices

The equations will follow the expected order of operations, first parsing parentheses, then division and multiplication, then addition and subtraction. The equation can also include negative numbers.

Equations can only operate on numeric columns and functions, including:

  • Function:
    • count
    • count_unique
    • count_if
    • failure_count
    • avg
    • sum
    • percentiles (p50, p75 etc.)
    • apdex
    • user_misery
    • eps() and epm()
  • Fields:
    • transaction.duration
    • measurements.fp
    • measurements.fcp
    • measurements.lcp
    • measurements.fid
    • measurements.cls
    • measurements.ttfb
    • spans.browser
    • spans.http
    • spans.db
    • spans.resource

Example equation

Calculate the percentage of completed transactions

Gets the percentage of transactions completed within the threshold

  1. Create a new query with the following three columns:
    • Column 1:
      • Function count_if
      • Field transaction.duration
      • Condition is less than or equal to
      • Set the final parameter to a threshold value (e.g300)
    • Column 2:
      • Function count
    • Column 3:
      • Field transaction
  2. Add an equation and enter it in the equation fieldcount_if(transaction.duration,lessOrEquals,300) / count() * 100.
Calculate the user-defined Apdex

Apdex is defined as (SATISFIED + Tolerable *0.5 + Frustrated *0)/total. If you wanted to change the tolerable weight to 0.2, you’d create the following query and equation.

  1. Create a new query with the following four columns:

    • Column 1:
      • Function count_if
      • Field transaction.duration
      • Condition is less than or equal to
      • Set the final parameter toSatisfiedThreshold (e.g.,300)
    • Column 2:
      • Function count_if
      • Field transaction.duration
      • Condition is less than or equal to
      • Set the final parameter toTolerableThreshold (e.g.,1200)
    • Column 3:
      • Function Count()
    • Column 4:
      • Field transaction
  2. Add the equation and enter the following in the Equation field:

(count_if(transaction.duration,lessOrEquals,300) + (count_if(transaction.duration,lessOrEquals,1200) - Count_if (transaction. Duration, lessOrEquals, 300)) * 0.2)/count ()

Find the maximum average non-database time

Find the longest transaction that is not from a database call.

  1. Create a new query with the following two columns:
    • Column 1:
      • Function avg
      • Field transaction.duration
    • Column 2:
      • Function avg
      • Field spans.db
  2. Add an equation and put it inequationFieldavg(transaction.duration) - avg(spans.db).
  3. According to the newequationSorting.

Discover trends with Discover

Discover is a powerful query engine that allows you to query all error metadata across projects and applications. You may have noticed that the Sentry SDK installed in your application captures a large number of events, each of which contains contextual data about underlying errors, platforms, devices, users, and so on. We also strongly encourage enriching your error data with the SDK by adding custom tags and configuring releases and environments. For more information, see Putting Your Data to Work.

  • Docs. Sentry. IO/product/sen…

Let’s walk through some examples of how to process all this data to gain some useful insights into application health and stability.

If you set a label with the same name as the Sentry field, some table column options may duplicate. For the following example, use the table column option labeled “Field.”

Through the Issues Discover

Sentry notifies you in real time when your application is interrupted, and then provides information and tools to categorize and resolve errors. With Discover, you can take a more proactive approach to finding the major issues that are breaking your application. The query might be built as follows:

  1. Navigate to the"Discover"And click the"Build a new query".
  2. inGlobal Header, select the item you want to query (projects), environment (environments) and error time range (time range of errors).
  3. Sentry monitors errors and performance for different types of events. To query the question (issues), please click in the search barevent.type:errorFilter.

  1. The editor"The Results"Table columns to show the number of events per item [count()], affected users [count_unique(user)] and unique issues [count_unique(issue)].

  1. After setting up these columns, you might want to find the most problematic items. Click on the COUNT_UNIQUE(ISSUE) column header to sort the row items accordingly.

  2. Hover the cursor over the item in the top project row, click the action icon that displays, and then select Add to Filter. This further Narrows your results so that you can continue to investigate the issues of that particular project.

  1. Now let’s see what those issues are. Change the table column to display:

    • Issue number
    • Title (Question title)
    • Count () (number of events)
    • Count_unique (user) (the only number of users affected by the problem)
  2. On each row item/issue, you can click the issue name to open the Issue Details page and sort the issues. You can also click the Open Group icon to continue querying the event stack in the context of a particular issue.

Through the Errors Discover

The real power of Discover is its ability to query all error metadata, so you are no longer limited to the context of issues or projects, and can reveal trends and insights across all applications. Let’s look at some examples.

URL error

Create a report that looks at all errors that occur in URL endpoints in your application.

  • Search criteria:event.type:error has:url
  • Table columns:url.platform.name.count()

  • By clicking on the"Add to filter"And change the table columns to see eitherURLThe endpoint.
  • Alternatively, use wildcard filteringURLMode:

Unhandled error

Whether your code is running on a mobile device, a browser, or a server, unhandled fatal errors can crash your application. To find out where these crashes occur, run the following query in Discover:

  • Search criteria:event.type:error handled:no level:fatal
  • Table columns:mechanism.platform.name.count()

To learn more about one of these crash types:

  • Select one of the row item values and add it to the filter.
  • Modify table columns to show crashesmessagecount().

The file with the most errors

To find out which files in the code base generate the most errors, run the following query in Discover:

  • Search criteria:event.type:error has:stack.filename
  • Table columns:stack.filename.count().count_unique(issue)

Change your Display selection to compare the current period with the previous period.

You can continue exploring specific file names by adding them to the filter and changing the table columns to show the main error culprits in that file:

Errors per Release

To see how the health of a particular project improves (or does not improve) over time when a new release is released, create the following query:

  • Search criteria:event.type:error
  • Table columns:release.count().count_unique(issue)

From here you can add a release as a filter and change the columns to count() and title to see similar errors. You can then click the “Open Group” icon to drill down into individual events. You can also open Release in “Releases” of the “Results” table.

Error in calculating by hour or by day

The timestamp. To_hour and timestamp. To_day fields round timestamp down to the last hour or day, respectively. For example, an event with timestamp value Mar 12, 2021 2:26:50 PM UTC has timestamp. To_hour value Mar 12, 2021 2:00:00 PM UTC, Timestamp. To_day the value is Mar 12, 2021 12:00:00 AM UTC. This allows you to group events. For example, you can display error counts for at least two hits per hour:

According to your User Settings in User Settings > Account > Account Details, all timestamps are displayed in your preferred time zone.

Other use cases

As you may have noticed by now, Discover is very useful in gaining visibility and insight into errors. For other use cases, see:

  • What are theissuesUsing up my quota?
    • Docs. Sentry. IO/product/acc…

  • Spike protection is active. – What do I do?
    • Docs. Sentry. IO/product/acc…