Skip to content

Commit e00cf9c

Browse files
committed
update profiling option in quick start guides
1 parent ba16594 commit e00cf9c

11 files changed

Lines changed: 107 additions & 139 deletions

File tree

docs/platforms/javascript/guides/aws-lambda/install/npm.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ Sentry.init({
116116
// ___PRODUCT_OPTION_END___ performance
117117
// ___PRODUCT_OPTION_START___ profiling
118118

119-
// Set sampling rate for profiling - this is relative to tracesSampleRate
120-
profilesSampleRate: 1.0,
119+
120+
// Enable profiling for a percentage of sessions
121+
// Learn more at
122+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
123+
profileSessionSampleRate: 1.0,
121124
// ___PRODUCT_OPTION_END___ profiling
122125
});
123126
```
@@ -148,8 +151,10 @@ Sentry.init({
148151
// ___PRODUCT_OPTION_END___ performance
149152
// ___PRODUCT_OPTION_START___ profiling
150153

151-
// Set sampling rate for profiling - this is relative to tracesSampleRate
152-
profilesSampleRate: 1.0,
154+
// Enable profiling for a percentage of sessions
155+
// Learn more at
156+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
157+
profileSessionSampleRate: 1.0,
153158
// ___PRODUCT_OPTION_END___ profiling
154159
});
155160
```

docs/platforms/javascript/guides/azure-functions/index.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ Sentry.init({
5858
// ___PRODUCT_OPTION_END___ performance
5959
// ___PRODUCT_OPTION_START___ profiling
6060

61-
// Set sampling rate for profiling - this is relative to tracesSampleRate
62-
profilesSampleRate: 1.0,
61+
// Enable profiling for a percentage of sessions
62+
// Learn more at
63+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
64+
profileSessionSampleRate: 1.0,
6365
// ___PRODUCT_OPTION_END___ profiling
6466
// ___PRODUCT_OPTION_START___ logs
6567

docs/platforms/javascript/guides/gcp-functions/index.mdx

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -40,77 +40,7 @@ Run the command for your preferred package manager to add the Sentry SDK to your
4040

4141
Make sure to initialize Sentry at the top of your function code and wrap each function with the appropriate helper. Select the tab that matches the kind of function you're using (HTTP, Background, or CloudEvent):
4242

43-
```javascript {tabTitle:Http functions}
44-
const Sentry = require("@sentry/google-cloud-serverless");
45-
46-
Sentry.init({
47-
dsn: "___PUBLIC_DSN___",
48-
49-
// Adds request headers and IP for users, for more info visit:
50-
// https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/options/#sendDefaultPii
51-
sendDefaultPii: true,
52-
// ___PRODUCT_OPTION_START___ performance
53-
54-
// Add Tracing by setting tracesSampleRate and adding integration
55-
// Set tracesSampleRate to 1.0 to capture 100% of transactions
56-
// We recommend adjusting this value in production
57-
// Learn more at
58-
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
59-
tracesSampleRate: 1.0,
60-
// ___PRODUCT_OPTION_END___ performance
61-
// ___PRODUCT_OPTION_START___ logs
62-
63-
// Enable logs to be sent to Sentry
64-
enableLogs: true,
65-
// ___PRODUCT_OPTION_END___ logs
66-
});
67-
68-
exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {
69-
// your code
70-
});
71-
```
72-
73-
```javascript {tabTitle:Background functions}
74-
const Sentry = require("@sentry/google-cloud-serverless");
75-
76-
Sentry.init({
77-
dsn: "___PUBLIC_DSN___",
78-
// ___PRODUCT_OPTION_START___ performance
79-
80-
// Add Tracing by setting tracesSampleRate and adding integration
81-
// Set tracesSampleRate to 1.0 to capture 100% of transactions
82-
// We recommend adjusting this value in production
83-
// Learn more at
84-
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
85-
tracesSampleRate: 1.0,
86-
// ___PRODUCT_OPTION_END___ performance
87-
});
88-
89-
exports.helloEvents = Sentry.wrapEventFunction((data, context, callback) => {
90-
// your code
91-
});
92-
```
93-
94-
```javascript {tabTitle:CloudEvent functions}
95-
const Sentry = require("@sentry/google-cloud-serverless");
96-
97-
Sentry.init({
98-
dsn: "___PUBLIC_DSN___",
99-
// ___PRODUCT_OPTION_START___ performance
100-
101-
// Add Tracing by setting tracesSampleRate and adding integration
102-
// Set tracesSampleRate to 1.0 to capture 100% of transactions
103-
// We recommend adjusting this value in production
104-
// Learn more at
105-
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
106-
tracesSampleRate: 1.0,
107-
// ___PRODUCT_OPTION_END___ performance
108-
});
109-
110-
exports.helloEvents = Sentry.wrapCloudEventFunction((context, callback) => {
111-
// your code
112-
});
113-
```
43+
<PlatformContent includePath="getting-started-config" />
11444

11545
## Step 3: Add Readable Stack Traces With Source Maps (Optional)
11646

docs/platforms/javascript/guides/react-router/index.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,10 @@ Sentry.init({
215215
tracesSampleRate: 1.0,
216216
// ___PRODUCT_OPTION_END___ performance
217217
// ___PRODUCT_OPTION_START___ profiling
218-
// Set profilesSampleRate to 1.0 to profile 100%
219-
// of sampled transactions.
220-
// This is relative to tracesSampleRate
218+
// Enable profiling for a percentage of sessions
221219
// Learn more at
222-
// https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#profilesSampleRate
223-
profilesSampleRate: 1.0,
220+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
221+
profileSessionSampleRate: 1.0,
224222
// ___PRODUCT_OPTION_END___ profiling
225223
});
226224
```

docs/platforms/javascript/guides/react-router/manual-setup.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,10 @@ Sentry.init({
275275
tracesSampleRate: 1.0,
276276
// ___PRODUCT_OPTION_END___ performance
277277
// ___PRODUCT_OPTION_START___ profiling
278-
// Set profilesSampleRate to 1.0 to profile 100%
279-
// of sampled transactions.
280-
// This is relative to tracesSampleRate
278+
// Enable profiling for a percentage of sessions
281279
// Learn more at
282-
// https://docs.sentry.io/platforms/javascript/guides/react-router/configuration/options/#profilesSampleRate
283-
profilesSampleRate: 1.0,
280+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
281+
profileSessionSampleRate: 1.0,
284282
// ___PRODUCT_OPTION_END___ profiling
285283
});
286284
```

platform-includes/getting-started-complete/javascript.remix.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Choose the features you want to configure, and this guide will show you how:
2424

2525
Run the command for your preferred package manager to add the Sentry SDK to your application:
2626

27+
<OnboardingOption optionId="profiling" hideForThisOption>
28+
2729
```bash {tabTitle:npm}
2830
npm install @sentry/remix --save
2931
```
@@ -36,6 +38,23 @@ yarn add @sentry/remix
3638
pnpm add @sentry/remix
3739
```
3840

41+
</OnboardingOption>
42+
43+
<OnboardingOption optionId="profiling">
44+
```bash {tabTitle:npm}
45+
npm install @sentry/remix @sentry/profiling-node --save
46+
```
47+
48+
```bash {tabTitle:yarn}
49+
yarn add @sentry/remix @sentry/profiling-node
50+
```
51+
52+
```bash {tabTitle:pnpm}
53+
pnpm add @sentry/remix @sentry/profiling-node
54+
```
55+
56+
</OnboardingOption>
57+
3958
## Step 2: Configure
4059

4160
### Configure Client-Side Sentry
@@ -164,13 +183,21 @@ Create an instrumentation file `instrument.server.mjs` in your project's root fo
164183

165184
```typescript {tabTitle:Server} {filename: instrument.server.mjs}
166185
import * as Sentry from "@sentry/remix";
186+
// ___PRODUCT_OPTION_START___ profiling
187+
import { nodeProfilingIntegration } from "@sentry/profiling-node";
188+
// ___PRODUCT_OPTION_END___ profiling
167189

168190
Sentry.init({
169191
dsn: "___PUBLIC_DSN___",
170192

171193
// Adds request headers and IP for users, for more info visit: and captures action formData attributes
172194
// https://docs.sentry.io/platforms/javascript/guides/remix/configuration/options/#sendDefaultPii
173195
sendDefaultPii: true,
196+
// ___PRODUCT_OPTION_START___ profiling
197+
198+
// Add our Profiling integration
199+
integrations: [nodeProfilingIntegration()],
200+
// ___PRODUCT_OPTION_END___ profiling
174201
// ___PRODUCT_OPTION_START___ performance
175202

176203
// Set tracesSampleRate to 1.0 to capture 100%
@@ -180,6 +207,13 @@ Sentry.init({
180207
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
181208
tracesSampleRate: 1.0,
182209
// ___PRODUCT_OPTION_END___ performance
210+
// ___PRODUCT_OPTION_START___ profiling
211+
212+
// Enable profiling for a percentage of sessions
213+
// Learn more at
214+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
215+
profileSessionSampleRate: 1.0,
216+
// ___PRODUCT_OPTION_END___ profiling
183217
// ___PRODUCT_OPTION_START___ logs
184218

185219
// Enable logs to be sent to Sentry

platform-includes/getting-started-config/javascript.aws-lambda.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ const { nodeProfilingIntegration } = require("@sentry/profiling-node");
66

77
Sentry.init({
88
dsn: "___PUBLIC_DSN___",
9-
9+
1010
// Adds request headers and IP for users, for more info visit:
1111
// https://docs.sentry.io/platforms/javascript/guides/aws-lambda/configuration/options/#sendDefaultPii
1212
sendDefaultPii: true,
1313
// ___PRODUCT_OPTION_START___ profiling
14-
15-
integrations: [
16-
nodeProfilingIntegration(),
17-
],
14+
15+
integrations: [nodeProfilingIntegration()],
1816
// ___PRODUCT_OPTION_END___ profiling
1917
// ___PRODUCT_OPTION_START___ performance
2018

@@ -27,8 +25,10 @@ Sentry.init({
2725
// ___PRODUCT_OPTION_END___ performance
2826
// ___PRODUCT_OPTION_START___ profiling
2927

30-
// Set sampling rate for profiling - this is relative to tracesSampleRate
31-
profilesSampleRate: 1.0,
28+
// Enable profiling for a percentage of sessions
29+
// Learn more at
30+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
31+
profileSessionSampleRate: 1.0,
3232
// ___PRODUCT_OPTION_END___ profiling
3333
});
3434

@@ -45,15 +45,13 @@ const { nodeProfilingIntegration } = require("@sentry/profiling-node");
4545

4646
Sentry.init({
4747
dsn: "___PUBLIC_DSN___",
48-
48+
4949
// Adds request headers and IP for users, for more info visit:
5050
// https://docs.sentry.io/platforms/javascript/guides/aws-lambda/configuration/options/#sendDefaultPii
5151
sendDefaultPii: true,
5252
// ___PRODUCT_OPTION_START___ profiling
53-
54-
integrations: [
55-
nodeProfilingIntegration(),
56-
],
53+
54+
integrations: [nodeProfilingIntegration()],
5755
// ___PRODUCT_OPTION_END___ profiling
5856
// ___PRODUCT_OPTION_START___ performance
5957

@@ -66,8 +64,10 @@ Sentry.init({
6664
// ___PRODUCT_OPTION_END___ performance
6765

6866
// ___PRODUCT_OPTION_START___ profiling
69-
// Set sampling rate for profiling - this is relative to tracesSampleRate
70-
profilesSampleRate: 1.0,
67+
// Enable profiling for a percentage of sessions
68+
// Learn more at
69+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
70+
profileSessionSampleRate: 1.0,
7171
// ___PRODUCT_OPTION_END___ profiling
7272
});
7373

platform-includes/getting-started-config/javascript.gcp-functions.mdx

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
```javascript {tabTitle:Http functions}
22
const Sentry = require("@sentry/google-cloud-serverless");
3+
// ___PRODUCT_OPTION_START___ profiling
34
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
5+
// ___PRODUCT_OPTION_END___ profiling
46

57
Sentry.init({
68
dsn: "___PUBLIC_DSN___",
7-
9+
810
// Adds request headers and IP for users, for more info visit:
911
// https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/options/#sendDefaultPii
1012
sendDefaultPii: true,
11-
13+
// ___PRODUCT_OPTION_START___ profiling
14+
1215
integrations: [
1316
nodeProfilingIntegration(),
1417
],
18+
// ___PRODUCT_OPTION_END___ profiling
1519
// ___PRODUCT_OPTION_START___ performance
1620

1721
// Add Performance Monitoring by setting tracesSampleRate
@@ -23,8 +27,10 @@ Sentry.init({
2327
// ___PRODUCT_OPTION_END___ performance
2428
// ___PRODUCT_OPTION_START___ profiling
2529

26-
// Set sampling rate for profiling - this is relative to tracesSampleRate
27-
profilesSampleRate: 1.0,
30+
// Enable profiling for a percentage of sessions
31+
// Learn more at
32+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
33+
profileSessionSampleRate: 1.0,
2834
// ___PRODUCT_OPTION_END___ profiling
2935
});
3036

@@ -35,18 +41,18 @@ exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {
3541

3642
```javascript {tabTitle:Background functions}
3743
const Sentry = require("@sentry/google-cloud-serverless");
44+
// ___PRODUCT_OPTION_START___ profiling
3845
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
46+
// ___PRODUCT_OPTION_END___ profiling
3947

4048
Sentry.init({
4149
dsn: "___PUBLIC_DSN___",
42-
43-
// Adds request headers and IP for users, for more info visit:
44-
// https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/options/#sendDefaultPii
45-
sendDefaultPii: true,
46-
50+
// ___PRODUCT_OPTION_START___ profiling
51+
4752
integrations: [
4853
nodeProfilingIntegration(),
4954
],
55+
// ___PRODUCT_OPTION_END___ profiling
5056
// ___PRODUCT_OPTION_START___ performance
5157

5258
// Add Performance Monitoring by setting tracesSampleRate
@@ -58,8 +64,10 @@ Sentry.init({
5864
// ___PRODUCT_OPTION_END___ performance
5965
// ___PRODUCT_OPTION_START___ profiling
6066

61-
// Set sampling rate for profiling - this is relative to tracesSampleRate
62-
profilesSampleRate: 1.0,
67+
// Enable profiling for a percentage of sessions
68+
// Learn more at
69+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
70+
profileSessionSampleRate: 1.0,
6371
// ___PRODUCT_OPTION_END___ profiling
6472
});
6573

@@ -79,6 +87,7 @@ const { nodeProfilingIntegration } = require("@sentry/profiling-node");
7987
Sentry.init({
8088
dsn: "___PUBLIC_DSN___",
8189
// ___PRODUCT_OPTION_START___ profiling
90+
8291
integrations: [
8392
nodeProfilingIntegration(),
8493
],
@@ -94,8 +103,10 @@ Sentry.init({
94103
// ___PRODUCT_OPTION_END___ performance
95104
// ___PRODUCT_OPTION_START___ profiling
96105

97-
// Set sampling rate for profiling - this is relative to tracesSampleRate
98-
profilesSampleRate: 1.0,
106+
// Enable profiling for a percentage of sessions
107+
// Learn more at
108+
// https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate
109+
profileSessionSampleRate: 1.0,
99110
// ___PRODUCT_OPTION_END___ profiling
100111
});
101112

0 commit comments

Comments
 (0)