You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have performance monitoring enabled and your application queries a database, you can see how your queries are performing in Sentry.
9
+
If you have [performance monitoring](/product/performance/) enabled and your application queries a database, you can see how your queries are performing in Sentry.
10
10
11
11
Sentry's query monitoring helps you investigate the performance of your queries and get more information to improve them.
12
12
@@ -40,7 +40,7 @@ Query monitoring works best with up-to-date SDK versions. The following minimum
40
40
41
41
Sentry tries to extract metrics for all SQL-like dialects, as well as MongoDB. Other NoSQL databases like Elasticsearch, graph databases like Neo4j, and other non-SQL database systems are not currently eligible for this feature.
42
42
43
-
If you are using <PlatformLinkto="/tracing/instrumentation/automatic-instrumentation">automatic instrumentation</PlatformLink>, query monitoring should work without any configuration. If you've manually instrumented Sentry, you'll need to make sure that your spans conform to our standards for the best experience:
43
+
If you are using <PlatformLinkto="/tracing/instrumentation/automatic-instrumentation">automatic instrumentation</PlatformLink>, query performance monitoring should work without any configuration. If you've manually instrumented Sentry, you'll need to make sure that your spans conform to our standards for the best experience:
44
44
45
45
- The span `op` field is set to an [eligible value](https://develop.sentry.dev/sdk/performance/span-operations/#database).
46
46
- The span's description contains the full, parameterized query (e.g. `"SELECT * FROM users WHERE id = ?"`). Supported placeholder values for SQL are `%s`, `?`, `:c0` (e.g. `:c0`, `:c1`) and `$1` (e.g. `$1`, `$2`). MongoDB span descriptions should contain valid JSON, and placeholders should be the string `"?"`.
@@ -50,11 +50,11 @@ If you are using <PlatformLink to="/tracing/instrumentation/automatic-instrument
50
50
51
51
The **Queries** page gives you a quick overview of your application's query performance for the selected project(s). You can use this page as a starting point to investigate potential problem queries and drill down to better understand how various queries are affecting your app's performance.
52
52
53
-
Open the **Queries** page by clicking "Queries" in the sidebar, under "Insights". Alternatively, the **Performance** page also surfaces the highest impact queries in the "Most Time-Consuming Queries" widget. From there, you can click "View All" to open the **Queries** page.
53
+
Open the **Queries** page by clicking "Queries" in the sidebar, under "Insights". Alternatively, the **Performance** page also surfaces the highest impact queries in the "Most Time-Consuming Queries" widget. You can click "View All" to open the **Queries** page from there.
54
54
55
55
At the top of the page, summary graphs for queries per minute (throughput) and average duration provide high-level insight into your database performance. If you see an anomaly or want to investigate a time range further, you can click and drag to select a range directly in a graph to filter data for that time range.
56
56
57
-
The query description table below shows a list of queries, along with their volume (queries per min), average duration, and the total time your app spent running that query (time spent). The query descriptions are parametrized, so your queries may look slightly different.
57
+
The query description table below shows a list of queries, their volume (queries per minute), average duration, and the total time your app spent running that query (time spent). The query descriptions are parametrized, so your queries may look slightly different.
58
58
59
59
By default, this table is sorted by most [time spent](#what-is-time-spent). This means that queries at the top are usually really slow, very frequent, or both. You can change this to sort by queries per minute to see the most frequently run queries, or by average duration to see the slowest queries.
60
60
@@ -64,7 +64,7 @@ To view more details, click on a query from the table to open its **Query Summar
64
64
65
65
### Query Parameterization
66
66
67
-
In some cases, Sentry processes queries and simplifies them to improve readability. For example, for SQL queries:
67
+
Sometimes, Sentry processes queries and simplifies them to improve readability. For example, for SQL queries:
68
68
69
69
- Table names are removed from column selections if possible (e.g., `SELECT "users"."name", "users"."id", "users.age" FROM users` becomes `SELECT name, id, age FROM users`)
70
70
- Long lists of `SELECT` arguments are collapsed (e.g., `SELECT id, name, age, city, country, phone FROM users` becomes `SELECT .. FROM users`)
@@ -96,7 +96,7 @@ Query Sources are currently supported in Sentry's [Laravel](/platforms/php/guide
96
96
97
97
</Alert>
98
98
99
-
A query's source is the location in your application's code that triggered the query. Sentry automatically determines the query source by examining the stack trace and attaches the source to the query data.
99
+
A query's source is the location in your application's code that triggered the query. Sentry automatically determines the query source by examining the [stack trace](/product/sentry-basics/integrate-frontend/upload-source-maps/) and attaches the source to the query data.
100
100
101
101
You can see the query's source underneath the query description on the **Query Summary** page, as shown in the image below. If you have a [source code management integration](/organization/integrations/source-code-mgmt/) enabled, Sentry will also show a link to open the query's source in the relevant repository.
102
102
@@ -106,7 +106,7 @@ You can see the query's source underneath the query description on the **Query S
106
106
107
107
Click on an endpoint to open its samples list. This side panel shows summary metrics (QPM and average duration) for the query in the specific endpoint.
108
108
109
-
The table shows a sample list of events, their span duration, and the difference in duration compared to average. This table is sorted by longest span duration.
109
+
The table shows a sample list of events, their span duration, and the difference in duration compared to the average. This table is sorted by longest span duration.
110
110
111
111
Sentry automatically finds a variety of samples to help you investigate performance problems. The chosen events will cover the entire selected time range, as well as a range of durations (both faster than, slower than, and near the average duration). You can get a sense of the performance characteristics by comparing different sample events.
112
112
@@ -120,8 +120,8 @@ From the sample list, you can drill down to specific good, average, or bad examp
120
120
121
121
By default, queries are sorted by **time spent**, which serves as a proxy for the relative impact of a given query.
122
122
123
-
Every database query takes some time to execute. When an application sends a query, it waits for the database to receive the query, parse it, execute it, and return the result. In Sentry, the total time taken from sending the query to receiving the full result is called the query's **duration**. The query's **time spent** is the sum of all its durations in a given time period.
123
+
Every database query takes some time to execute. When an application sends a query, it waits for the database to receive the query, parse it, execute it, and return the result. In Sentry, the total time taken from sending the query to receiving the full result is called the query's **duration**. The query's **time spent** is the sum of all its durations in a given period.
124
124
125
-
For example, an application might send a query like `SELECT * FROM users LIMIT 10` every time a user calls the `/users` endpoint. The query might take anywhere from 100ms to 200ms to run, and the endpoint is called anywhere from 10 times a minute to 100 times in a minute depending on the time of day. The query's time spent is the sum of all of its durations that occurred in a given time period. Put another way, the time spent is the product of the average duration and queries per minute. In a high-throughput application, a query's time spent might be measured in weeks or months.
125
+
For example, an application might send a query like `SELECT * FROM users LIMIT 10` every time a user calls the `/users` endpoint. The query might take anywhere from 100ms to 200ms to run, and the endpoint is called anywhere from 10 times a minute to 100 times in a minute depending on the time of day. The query's time spent is the sum of all of its durations that occurred in a given period. Put another way, the time spent is the product of the average duration and queries per minute. In a high-throughput application, a query's time spent might be measured in weeks or months.
126
126
127
-
Time spent is a useful way to measure a query's relative impact, compared to other queries in an application. For example, if one query's time spent is 7 days, and another is just 2 hours, the query with more time spent is probably more impactful to fix. Even a small improvement in duration would result in a meaningful overall improvement. Time spent can also be a strong signal that something is wrong. Queries that suddenly start taking up more time are often signal a problem.
127
+
Time spent is a useful way to measure a query's relative impact, compared to other queries in an application. For example, if one query's time spent is 7 days, and another is just 2 hours, the query with more time spent is probably more impactful to fix. Even a small improvement in duration would result in a meaningful overall improvement. Time spent can also be a strong signal that something is wrong. Queries that suddenly start taking up more time often signal a problem.
0 commit comments