Skip to content

Commit 55274b9

Browse files
authored
tweak: error & performance tracking (#563)
* tweak: error & performance track * chore: update build env
1 parent 43ca592 commit 55274b9

File tree

6 files changed

+523
-2
lines changed

6 files changed

+523
-2
lines changed

.github/workflows/production.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
GATSBY_DOC_BUILD_DATE: ${{ steps.submodule.outputs.build_date }}
9191
GATSBY_DOC_BUILD_GIT_SHA: ${{ steps.submodule.outputs.git_sha }}
9292
GATSBY_DOC_BUILD_SUBMODULE_SHA: ${{ steps.submodule.outputs.submodule_status }}
93+
GATSBY_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
9394
run: |
9495
yarn build --verbose
9596

gatsby-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = {
1818
},
1919
jsxRuntime: "automatic",
2020
plugins: [
21+
{
22+
resolve: "@sentry/gatsby",
23+
},
2124
{
2225
resolve: "gatsby-plugin-google-tagmanager",
2326
options: {

gatsby-node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require("ts-node").register({ transpileOnly: true });
2+
require("dotenv").config();
23

34
const path = require("path");
45

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@mui/lab": "^5.0.0-alpha.95",
2727
"@mui/material": "^5.10.0",
2828
"@seagreenio/react-bulma": "^0.1.0-beta.4",
29+
"@sentry/gatsby": "^8.42.0",
2930
"algoliasearch": "^4.11.0",
3031
"axios": "^0.24.0",
3132
"clsx": "^1.1.1",

sentry.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from "@sentry/gatsby";
2+
3+
Sentry.init({
4+
environment: process.env.NODE_ENV,
5+
dsn: process.env.GATSBY_SENTRY_DSN,
6+
integrations: [Sentry.browserTracingIntegration()],
7+
8+
tracesSampleRate: 0.1,
9+
});

0 commit comments

Comments
 (0)