Skip to content

Commit 2843ceb

Browse files
authored
ref(perf): Update JS sample rates to 1.0 (#6288)
1 parent 72abebf commit 2843ceb

File tree

14 files changed

+45
-57
lines changed

14 files changed

+45
-57
lines changed

src/platform-includes/performance/configure-sample-rate/javascript.electron.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ Sentry.init({
1515
// necessary for purely manual usage
1616
integrations: [new BrowserTracing()],
1717

18-
// To set a uniform sample rate
19-
tracesSampleRate: 0.2
20-
21-
// Alternatively, to control sampling dynamically
22-
tracesSampler: samplingContext => { ... }
18+
// We recommend adjusting this value in production, or using tracesSampler
19+
// for finer control
20+
tracesSampleRate: 1.0,
2321
});
2422
```

src/platform-includes/performance/configure-sample-rate/javascript.ember.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import * as Sentry from "@sentry/ember";
44
Sentry.init({
55
dsn: "___PUBLIC_DSN___",
66

7-
// To set a uniform sample rate
8-
tracesSampleRate: 0.2,
9-
10-
// Alternatively, to control sampling dynamically
11-
tracesSampler: samplingContext => { ... }
7+
// We recommend adjusting this value in production, or using tracesSampler
8+
// for finer control
9+
tracesSampleRate: 1.0,
1210
});
1311
```

src/platform-includes/performance/configure-sample-rate/javascript.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ Sentry.init({
1616
// necessary for purely manual usage
1717
integrations: [new BrowserTracing()],
1818

19-
// To set a uniform sample rate
20-
tracesSampleRate: 0.2
21-
22-
// Alternatively, to control sampling dynamically
23-
tracesSampler: samplingContext => { ... }
19+
// We recommend adjusting this value in production, or using tracesSampler
20+
// for finer control
21+
tracesSampleRate: 1.0,
2422
});
2523
```
2624

@@ -32,10 +30,8 @@ Sentry.init({
3230
// necessary for purely manual usage
3331
integrations: [new Sentry.BrowserTracing()],
3432

35-
// To set a uniform sample rate
36-
tracesSampleRate: 0.2
37-
38-
// Alternatively, to control sampling dynamically
39-
tracesSampler: samplingContext => { ... }
33+
// We recommend adjusting this value in production, or using tracesSampler
34+
// for finer control
35+
tracesSampleRate: 1.0,
4036
});
4137
```

src/platform-includes/performance/configure-sample-rate/javascript.nextjs.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import * as Sentry from "@sentry/nextjs";
66
Sentry.init({
77
dsn: "___PUBLIC_DSN___",
88

9-
// To set a uniform sample rate
10-
tracesSampleRate: 0.2,
11-
12-
// Alternatively, to control sampling dynamically
13-
tracesSampler: samplingContext => { ... }
9+
// We recommend adjusting this value in production, or using tracesSampler
10+
// for finer control
11+
tracesSampleRate: 1.0,
1412
});
1513
```

src/platform-includes/performance/configure-sample-rate/javascript.react.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ Sentry.init({
1414
// necessary for purely manual usage
1515
integrations: [new BrowserTracing()],
1616

17-
// To set a uniform sample rate
18-
tracesSampleRate: 0.2
19-
20-
// Alternatively, to control sampling dynamically
21-
tracesSampler: samplingContext => { ... }
17+
// We recommend adjusting this value in production, or using tracesSampler
18+
// for finer control
19+
tracesSampleRate: 1.0,
2220
});
2321
```

src/platform-includes/performance/configure-sample-rate/javascript.vue.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ Sentry.init({
1717
// necessary for purely manual usage
1818
integrations: [new BrowserTracing()],
1919

20-
// To set a uniform sample rate
21-
tracesSampleRate: 0.2
22-
23-
// Alternatively, to control sampling dynamically
24-
tracesSampler: samplingContext => { ... }
20+
// We recommend adjusting this value in production, or using tracesSampler
21+
// for finer control
22+
tracesSampleRate: 1.0,
2523
});
2624
```
2725

@@ -33,11 +31,9 @@ Sentry.init({
3331
// necessary for purely manual usage
3432
integrations: [new Sentry.BrowserTracing()],
3533

36-
// To set a uniform sample rate
37-
tracesSampleRate: 0.2
38-
39-
// Alternatively, to control sampling dynamically
40-
tracesSampler: samplingContext => { ... }
34+
// We recommend adjusting this value in production, or using tracesSampler
35+
// for finer control
36+
tracesSampleRate: 1.0,
4137
});
4238
```
4339

src/platform-includes/performance/configure-sample-rate/react-native.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import * as Sentry from "@sentry/react-native";
66
Sentry.init({
77
dsn: "___PUBLIC_DSN___",
88

9-
// To set a uniform sample rate
10-
tracesSampleRate: 0.2
11-
12-
// Alternatively, to control sampling dynamically
13-
tracesSampler: samplingContext => { ... }
9+
// We recommend adjusting this value in production, or using tracesSampler
10+
// for finer control
11+
tracesSampleRate: 1.0,
1412
});
1513
```

src/platform-includes/performance/enable-automatic-instrumentation/javascript.ember.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import * as Sentry from "@sentry/ember";
88
Sentry.init({
99
dsn: "___PUBLIC_DSN___",
1010

11-
// To set a uniform sample rate
12-
tracesSampleRate: 0.2,
11+
// We recommend adjusting this value in production, or using tracesSampler
12+
// for finer control
13+
tracesSampleRate: 1.0,
1314

1415
// Configuration for Ember's default tracing integration.
1516
browserTracingOptions: {

src/platform-includes/performance/tracePropagationTargets-example/javascript.ember.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ import * as Sentry from "@sentry/ember";
1212
Sentry.init({
1313
dsn: "___PUBLIC_DSN___",
1414

15-
// To set a uniform sample rate
16-
tracesSampleRate: 0.2,
15+
// We recommend adjusting this value in production, or using tracesSampler
16+
// for finer control
17+
tracesSampleRate: 1.0,
1718

1819
browserTracingOptions: {
19-
tracePropagationTargets: ["localhost", "my-site-url.com", "api.example.com"],
20+
tracePropagationTargets: [
21+
"localhost",
22+
"my-site-url.com",
23+
"api.example.com",
24+
],
2025
},
2126
});
2227
```

src/platform-includes/performance/traces-sample-rate/javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Sentry.init({
33
// ...
44

5-
tracesSampleRate: 0.2,
5+
tracesSampleRate: 0.5,
66
});
77
```

src/platform-includes/performance/traces-sample-rate/node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Sentry.init({
33
// ...
44

5-
tracesSampleRate: 0.2,
5+
tracesSampleRate: 0.5,
66
});
77
```

src/platform-includes/performance/traces-sampler-as-filter/javascript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Sentry.init({
88
return 0;
99
} else {
1010
// Default sample rate for all others (replaces tracesSampleRate)
11-
return 0.1;
11+
return 1;
1212
}
13-
}
13+
},
1414
});
1515
```

src/platform-includes/performance/traces-sampler-as-sampler/javascript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Sentry.init({
99

1010
if ("...") {
1111
// These are important - take a big sample
12-
return 0.5;
12+
return 1;
1313
} else if ("...") {
1414
// These are less important or happen much more frequently - only take 1%
1515
return 0.01;
@@ -18,7 +18,7 @@ Sentry.init({
1818
return 0;
1919
} else {
2020
// Default sample rate
21-
return 0.1;
21+
return 0.5;
2222
}
2323
};
2424
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
To do this, set the <PlatformIdentifier name="traces-sample-rate" /> option in your `Sentry.init()` to a number between 0 and 1. With this option set, every transaction created will have that percentage chance of being sent to Sentry. (So, for example, if you set <PlatformIdentifier name="traces-sample-rate" /> to `0.2`, approximately 20% of your transactions will get recorded and sent.) That looks like this:
1+
To do this, set the <PlatformIdentifier name="traces-sample-rate" /> option in your `Sentry.init()` to a number between 0 and 1. With this option set, every transaction created will have that percentage chance of being sent to Sentry. (So, for example, if you set <PlatformIdentifier name="traces-sample-rate" /> to `0.5`, approximately 50% of your transactions will get recorded and sent.) That looks like this:
22

33
<PlatformContent includePath="performance/traces-sample-rate" />

0 commit comments

Comments
 (0)