Skip to content

Commit c703d80

Browse files
authored
Update: Performance Docs (#1801)
Performance docs need a few more details before GA
1 parent f90ef62 commit c703d80

File tree

8 files changed

+209
-16
lines changed

8 files changed

+209
-16
lines changed

__tests__/__snapshots__/documentation.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ Array [
285285
"performance-monitoring/discover-queries/index.html",
286286
"performance-monitoring/discover-queries/query-builder/index.html",
287287
"performance-monitoring/distributed-tracing/index.html",
288+
"performance-monitoring/getting-started/index.html",
288289
"performance-monitoring/performance/event-detail/index.html",
289290
"performance-monitoring/performance/index.html",
290291
"performance-monitoring/performance/metrics/index.html",
291292
"performance-monitoring/performance/transaction-summary/index.html",
292-
"performance-monitoring/setup/index.html",
293293
"platforms/android/index.html",
294294
"platforms/android/migrate/index.html",
295295
"platforms/cocoa/dsym/index.html",

nginx.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ server {
527527
location = /guides/manage-event-stream/ {
528528
return 302 /accounts/quotas/manage-event-stream-guide/;
529529
}
530+
531+
location = /performance-monitoring/setup/ {
532+
return 302 /performance-monitoring/getting-started/;
533+
}
530534

531535
# these should match what is in server.js
532536
location ~ ^/(platforms|clients|error-reporting|enriching-error-data|performance-monitoring|workflow|data-management|accounts|cli|api|guides|support|sdks)/ {

src/_data/platforms.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
support_level: production
44
type: framework
55
name: Node.js
6-
doc_link: /performance-monitoring/setup/?platform=node
6+
doc_link: /performance-monitoring/getting-started/?platform=node
77
wizard_parent: node
88
wizard:
99
- _documentation/performance-monitoring/configuration/node.md#node-tracing
@@ -173,7 +173,7 @@
173173
support_level: production
174174
type: language
175175
name: Python
176-
doc_link: /performance-monitoring/setup/?platform=python
176+
doc_link: /performance-monitoring/getting-started/?platform=python
177177
wizard_parent: python
178178
wizard:
179179
- _documentation/performance-monitoring/configuration/python.md#python-tracing

src/collections/_documentation/performance-monitoring/configuration/javascript.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,88 @@ function processItem(item, transaction) {
172172
});
173173
}
174174
```
175+
176+
**Grouping Transactions**
177+
178+
When Sentry captures transactions, they are assigned a transaction name. This name is generally auto-generated by the Sentry SDK based on the framework integrations you are using. If you can't leverage the automatic transaction generation (or want to customize how transaction names are generated) you can use a global event processor that is registered when you initialize the SDK with your configuration.
179+
180+
An example of doing this in a node.js application:
181+
182+
```javascript
183+
import { addGlobalEventProcessor } from '@sentry/node';
184+
185+
addGlobalEventProcess(event => {
186+
// if event is a transaction event
187+
if (event.type === "transaction") {
188+
event.transaction = sanitizeTransactionName(event.transaction);
189+
}
190+
return event;
191+
});
192+
```
193+
194+
For browser JavaScript applications using the `Tracing` integration, the `beforeNavigate` option can be used to better group navigation/pageload transactions together based on URL.
195+
196+
```javascript
197+
import * as Sentry from '@sentry/browser';
198+
import { Integrations as ApmIntegrations } from '@sentry/apm';
199+
200+
Sentry.init({
201+
// ...
202+
integrations: [
203+
new ApmIntegrations.Tracing({
204+
beforeNavigate: (location) => {
205+
// You could use your UI's routing library to find the matching
206+
// route template here. We don't have one right now, so do some basic
207+
// parameter replacements.
208+
return location.pathname
209+
.replace(/\d+/g, '<digits>')
210+
.replace(/[a-f0-9]{32}/g, '<hash>');
211+
},
212+
}),
213+
],
214+
});
215+
```
216+
217+
**Adding Query Information and Parameters to Spans**
218+
219+
Currently, every tag has a maximum character limit of 200 characters. Tags over the 200 character limit will become truncated, losing potentially important information. To retain this data, you can split data over several tags instead.
220+
221+
For example, a 200+ character tagged request:
222+
223+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=161803398874989484820458683436563811772030917980576`
224+
225+
The 200+ character request above will become truncated to:
226+
227+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=1618033988749894848`
228+
229+
Instead, using `span.setTag` splits the details of this request over several tags. This could be done over `baseUrl`, `endpoint`, `parameters`, in this case, resulting in three different tags:
230+
231+
```javascript
232+
const span = transaction.startChild({
233+
op: "request",
234+
description: "setup form"
235+
});
236+
span.setTag("baseUrl", baseUrl);
237+
span.setTag("endpoint", endpoint);
238+
span.setTag("parameters", parameters);
239+
http.get(`${base_url}/${endpoint}/`, data=parameters);
240+
...
241+
```
242+
243+
baseUrl
244+
245+
: `https://empowerplant.io`
246+
247+
endpoint
248+
249+
: `api/0/projects/ep/setup_form`
250+
251+
parameters
252+
253+
: ```{
254+
"user_id": 314159265358979323846264338327,
255+
"tracking_id": "EasyAsABC123OrSimpleAsDoReMi",
256+
"product_name": PlantToHumanTranslator,
257+
"product_id": 161803398874989484820458683436563811772030917980576,
258+
}
259+
```

src/collections/_documentation/performance-monitoring/configuration/python.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ hide_from_sidebar: true
44

55
To get started with performance monitoring using Sentry's Python SDK, first install the `sentry_sdk` package:
66

7-
```
8-
$ pip install sentry_sdk
7+
```python
8+
import sentry_sdk
99
```
1010

1111
Next, initialize the integration in your call to `sentry_sdk.init`:
1212

1313
```python
14-
import sentry_sdk
15-
1614
sentry_sdk.init(
1715
"___PUBLIC_DSN___",
1816
traces_sample_rate = 0.25
@@ -101,3 +99,51 @@ def process_item(item):
10199
```
102100

103101
<!-- ENDWIZARD -->
102+
103+
**Adding Query Information and Parameters to Spans**
104+
105+
Currently, every tag has a maximum character limit of 200 characters. Tags over the 200 character limit will become truncated, losing potentially important information. To retain this data, you can split data over several tags instead.
106+
107+
For example, a 200+ character tagged request:
108+
109+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=161803398874989484820458683436563811772030917980576`
110+
111+
The 200+ character request above will become truncated to:
112+
113+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=1618033988749894848`
114+
115+
Instead, using `span.set_tag` splits the details of this query over several tags. This could be done over `base_url`, `endpoint`, `parameters`, in this case, resulting in three different tags:
116+
```python
117+
import sentry_sdk
118+
...
119+
with sentry_sdk.start_span(op="request", transaction="setup form") as span:
120+
span.set_tag("base_url", base_url)
121+
span.set_tag("endpoint", endpoint)
122+
span.set_tag("parameters", parameters)
123+
make_request(
124+
"{base_url}/{endpoint}/".format(
125+
base_url=base_url,
126+
endpoint=endpoint,
127+
),
128+
data=parameters
129+
)
130+
...
131+
```
132+
133+
baseUrl
134+
135+
: `https://empowerplant.io`
136+
137+
endpoint
138+
139+
: `api/0/projects/ep/setup_form`
140+
141+
parameters
142+
143+
: ```{
144+
"user_id": 314159265358979323846264338327,
145+
"tracking_id": "EasyAsABC123OrSimpleAsDoReMi",
146+
"product_name": PlantToHumanTranslator,
147+
"product_id": 161803398874989484820458683436563811772030917980576,
148+
}
149+
```

src/collections/_documentation/performance-monitoring/setup.md renamed to src/collections/_documentation/performance-monitoring/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Setup
2+
title: Getting Started
33
sidebar_order: 0
44
---
55

src/collections/_documentation/performance-monitoring/performance/event-detail.md

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ From [Performance](/performance-monitoring/performance/index) and [Discover](/pe
1010
Information about this specific event is located in the sidebar, listing out the Event ID, date and time of occurrence, project, and downloadable JSON package. More can be found under Event Tag Details. You'll also get a breakdown of operations, which will correspond to the waterfall span view as a legend.
1111

1212
{% capture __alert_content -%}
13-
Currently, only root transactions are searchable. Any span data that inherits from it's root are not.
13+
Currently, only root transactions are searchable. Any span data that inherits from its root are not.
1414
{%- endcapture -%}
1515
{%- include components/alert.html
1616
title="Warning"
@@ -20,20 +20,30 @@ Currently, only root transactions are searchable. Any span data that inherits fr
2020

2121
## Span View
2222

23+
The span view is a split view where the left-hand side shows the transaction’s span tree, and the right-hand side represents each span as a colored rectangle. Within the tree view, Sentry identifies spans by their `op` and `description` values. If a span doesn’t have a description, Sentry uses the span’s id as a fallback. The first span listed is always the transaction’s root span, from which all other spans in the transaction descend.
24+
2325
[{% asset performance/span-details.png alt="Span detail view shows the span id, trace id, parent span id, and other data such as tags." %}]({% asset performance/span-details.png @path %})
2426

27+
To find these views, you can either go through the [Transaction Summary](/performance-monitoring/performance/transaction-summary) or [Query Builder](/performance-monitoring/discover-queries/query-builder/). Event IDs will be linked to open the corresponding Event Detail.
28+
29+
**With Transaction Summary**
30+
31+
Select the [Performance Homepage](/performance-monitoring/performance/index), then click the affected transaction to display the trace data.
32+
33+
**With Query Builder**
34+
35+
Scroll down to the "Trace Details" context panel in either the Issue Details or the Discover Event Details page, and click on the "View Summary" button. This will maintain the context of the current Sentry event.
36+
37+
_Note_: Users on the Team or Business plans can also view a list of transaction events by clicking on the "Transactions" pre-built query in [Discover](/performance-monitoring/discover-queries/index) or by performing a search with the `event.type:transaction` condition the Discover Query Builder view.
38+
2539
### Minimap
2640

27-
The minimap reflects the entirety of the transaction broken into spans. You can either click and drag your cursor across the minimap to zoom in or adjust the window selection by dragging the handlebar in from the side. This will affect the range you see in the waterfall view.
41+
The minimap (top of the span view) reflects the entirety of the transaction broken into spans. You can either click and drag your cursor across the minimap to zoom in or adjust the window selection by dragging the handlebar (black dashed lines) in from the side. This will affect the range you see in the waterfall view.
2842

2943
### Waterfall
3044

3145
The waterfall view is a split view where the left reflects the transaction's span tree, and the right reflects each span as a horizontal bar (colors represent the operation). Within the tree, Sentry identifies spans by their `operation` and `description` values. If a span doesn't have a description, Sentry uses the span's ID as a fallback. The first span listed is always the transaction's root span, from which all other spans in the transaction descend.
3246

33-
_Missing Instrumentation_
34-
35-
Gaps between spans may be marked as "Missing Instrumentation." TThis means a duration in the transaction that isn't accounted for by any of the transaction's spans. It likely means that you need to manually instrument that part of your process. Go back to the [performance setup](/performance-monitoring/setup) for details.
36-
3747
### Span Details
3848

3949
Clicking on a span row expands the details of that span. From here, you can see all attached properties, such as tags and other field data. With the Trace ID, you'll be able to view all transactions within that given trace. Click "Search by Trace" to view that Discover list. Learn more about [distributed tracing](/performance-monitoring/distributed-tracing/) in our docs.
@@ -49,7 +59,7 @@ The trace view may be limited to one project at a time if you're on the [Team pl
4959
level="info"
5060
%}
5161

52-
_Traversing Transactions_
62+
**Traversing Transactions**
5363

5464
Some spans within a transaction may be the parent of another transaction. Under these circumstances, some Span IDs will have a "View Child" or "View Children" button. These will potentially lead to another transaction or a list of transactions.
5565

@@ -63,3 +73,49 @@ Traversing between parent and child transactions is only available on the [Busin
6373
content=__alert_content
6474
level="info"
6575
%}
76+
77+
**Adding Query Information and Parameters to Spans**
78+
79+
Currently, every tag has a maximum character limit of 200 characters. Tags over the 200 character limit will become truncated, losing potentially important information. To retain this data, you can split data over several tags instead.
80+
81+
For example, a 200+ character tagged request:
82+
83+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=161803398874989484820458683436563811772030917980576`
84+
85+
The 200+ character request above will become truncated to:
86+
87+
`https://empowerplant.io/api/0/projects/ep/setup_form/?user_id=314159265358979323846264338327&tracking_id=EasyAsABC123OrSimpleAsDoReMi&product_name=PlantToHumanTranslator&product_id=1618033988749894848`
88+
89+
Instead, using `span.set_tag` you could split the details of this query over several tags. This could be done over `columns`, `tables`, `conditions`, in this case, resulting in three different tags:
90+
91+
```python
92+
import sentry_sdk
93+
94+
...
95+
96+
with sentry_sdk.start_span(op="db", transaction="query api") as span:
97+
span.set_tag("columns", columns)
98+
span.set_tag("tables", tables)
99+
span.set_tag("conditions", conditions)
100+
span.set_tag("query_format", query_format)
101+
query_format = "SELECT {columns} FROM {tables} WHERE {conditions}"
102+
query = query_format.format(
103+
columns=columns,
104+
tables=tables,
105+
conditions=conditions,
106+
)
107+
...
108+
```
109+
110+
columns
111+
: `first_column, second_column, third_columns, fourth_column, fifth_column, sixth_column`
112+
113+
tables
114+
: `this_is_a_long_table_name`
115+
116+
conditions
117+
: `first_column=some_value AND second_column=some_other_value AND third_column=yet_another_value`
118+
119+
### Missing Instrumentation
120+
121+
Gaps between spans may be marked as "Missing Instrumentation." This means a duration in the transaction that isn't accounted for by any of the transaction's spans. It likely means that you need to manually instrument that part of your process. Go back to the [performance setup](/performance-monitoring/setup) for details.

src/collections/_documentation/performance-monitoring/performance/transaction-summary.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ The table also updates dynamically if you change any of the selections in the gl
3636

3737
When viewing transactions, you may want to create more curated views. Click "Open in Discover" above the table to create a custom query to investigate further. For more details, see the full documentation for the Discover [Query Builder](/performance-monitoring/discover-queries/query-builder/).
3838

39-
## Metrics Sidebar
39+
_Note_: Currently, only transaction data - the transaction name and any attributes the transaction inherits from its root span - is searchable. Data contained in spans other than the root span is not indexed and therefore cannot be searched.
40+
41+
## Related Issues
4042

4143
The sidebar contains helpful supplementary information about this transaction's [User Misery](/performance-monitoring/performance/metrics/#user-misery), [Apdex](/performance-monitoring/performance/metrics/#apdex), [Throughput](/performance-monitoring/performance/metrics/#throughput-total-tpm-tps), [Latency](/performance-monitoring/performance/metrics/#latency), and more. You'll also find a Tag Summary (facet map) for a list of common tags related to this transaction.
4244

0 commit comments

Comments
 (0)