Skip to content

Commit 19edcec

Browse files
authored
Add Session Replay to Sentry docs (#6245)
1 parent c4e1f9c commit 19edcec

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"@mdx-js/react": "^1.6.18",
1717
"@sentry-internal/global-search": "0.1.3",
1818
"@sentry/gatsby": "^7.36.0",
19-
"@sentry/tracing": "^7.36.0",
2019
"@sentry/webpack-plugin": "^1.18.3",
2120
"@types/dompurify": "^2.0.3",
2221
"@types/node": "^12",

sentry.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as Sentry from "@sentry/gatsby";
2+
3+
const activeEnv =
4+
process.env.GATSBY_ENV || process.env.NODE_ENV || "development";
5+
6+
Sentry.init({
7+
debug: true,
8+
dsn: process.env.SENTRY_DSN,
9+
release: process.env.SENTRY_RELEASE,
10+
integrations: [
11+
new Sentry.Replay({
12+
maskAllText: true,
13+
blockAllMedia: true,
14+
}),
15+
],
16+
tracesSampleRate: activeEnv === "development" ? 0 : 1,
17+
replaysSessionSampleRate: activeEnv === "development" ? 0 : 0.1,
18+
replaysOnErrorSampleRate: activeEnv === "development" ? 0 : 1,
19+
});

src/gatsby/config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import resolveOpenAPI from "./utils/resolveOpenAPI";
66
const packages = new PackageRegistry();
77
const apps = new AppRegistry();
88

9-
const activeEnv =
10-
process.env.GATSBY_ENV || process.env.NODE_ENV || "development";
11-
129
const root = `${__dirname}/../..`;
1310

1411
process.env.DISABLE_THUMBNAILS = process.env.DISABLE_THUMBNAILS || "0";
@@ -83,11 +80,6 @@ const getPlugins = () => {
8380
const plugins = [
8481
{
8582
resolve: "@sentry/gatsby",
86-
options: {
87-
dsn: process.env.SENTRY_DSN,
88-
release: process.env.SENTRY_RELEASE,
89-
tracesSampleRate: activeEnv === "development" ? 0 : 1,
90-
},
9183
},
9284
"gatsby-plugin-sharp",
9385
"gatsby-plugin-sass",

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@
22042204
"@sentry/types" "7.36.0"
22052205
"@sentry/utils" "7.36.0"
22062206

2207-
"@sentry/[email protected]", "@sentry/tracing@^7.36.0":
2207+
22082208
version "7.36.0"
22092209
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.36.0.tgz#aa38319ed07f3b642134cf47da81f43df7835629"
22102210
integrity sha512-5R5mfWMDncOcTMmmyYMjgus1vZJzIFw4LHaSbrX7e1IRNT/6vFyNeVxATa2ePXb9mI3XHo5f2p7YrnreAtaSXw==

0 commit comments

Comments
 (0)