Skip to content

Commit

Permalink
Add Sentry plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jun 5, 2020
1 parent 9917a02 commit a9881e6
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ const getPlugins = () => {
{
resolve: require.resolve("./plugins/gatsby-plugin-include"),
},
{
resolve: require.resolve("./plugins/gatsby-plugin-sentry"),
options: {
dsn:
process.env.SENTRY_DSN ||
"https://[email protected]/5266138",
},
},
{
resolve: "gatsby-remark-prismjs",
options: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"dependencies": {
"@mdx-js/mdx": "^1.6.1",
"@mdx-js/react": "^1.6.1",
"@sentry/apm": "^5.16.1",
"@sentry/browser": "^5.16.1",
"add": "^2.0.6",
"algoliasearch": "^4.2.0",
"bootstrap": "4.3.1",
Expand Down
13 changes: 13 additions & 0 deletions plugins/gatsby-plugin-sentry/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exports.onClientEntry = function (_, pluginParams) {
require.ensure(["@sentry/browser", "@sentry/apm"], function (require) {
const Sentry = require("@sentry/browser");
const TracingIntegration = require("@sentry/apm").Integrations.Tracing;
Sentry.init({
environment: process.env.NODE_ENV || "development",
tracesSampleRate: 1,
...pluginParams,
integrations: [new TracingIntegration()],
});
window.Sentry = Sentry;
});
};
Empty file.
14 changes: 14 additions & 0 deletions plugins/gatsby-plugin-sentry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "gatsby-plugin-sentry",
"version": "1.0.0",
"main": "index.js",
"license": "Apache-2.0",
"peerDependencies": {
"gatsby": "^2.0.0"
},
"dependencies": {
"@sentry/browser": "*",
"@sentry/apm": "*"
}
}

69 changes: 69 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,70 @@
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"

"@sentry/apm@^5.16.1":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.16.1.tgz#c2f356c8123d791da29b56c7a677715ff16ea788"
integrity sha512-sAOsWdQYRuEFOyAv4ZDIrGSaBIVgNJyWZBXIFH4RBrvQgKd8h98g4NXnt5QQqHO56awaO5DGl9XQ3hnd4jZEJg==
dependencies:
"@sentry/browser" "5.16.1"
"@sentry/hub" "5.16.1"
"@sentry/minimal" "5.16.1"
"@sentry/types" "5.16.1"
"@sentry/utils" "5.16.1"
tslib "^1.9.3"

"@sentry/[email protected]", "@sentry/browser@^5.16.1":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.16.1.tgz#7a5ad85d9002de1495b1f63c3a4edb688a27f644"
integrity sha512-uXXKRGLWDqwaKO09K1GTTV0Yj+OfELVs+0cDDYqPDow+DlIXyx0gSnZPd0caCqFllUy8JSxb4S9OprYinvks2A==
dependencies:
"@sentry/core" "5.16.1"
"@sentry/types" "5.16.1"
"@sentry/utils" "5.16.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.16.1.tgz#c5c2f5d3391440f62b3e4dbefafc776449c45c35"
integrity sha512-CDKUAUWefZ+bx7tUGm7pgkuJbwn+onAlwzKkLGVg730IP+N/AWSpVtbvFTPiel2+NPiFhWX5/F0SpxDMLPRKfg==
dependencies:
"@sentry/hub" "5.16.1"
"@sentry/minimal" "5.16.1"
"@sentry/types" "5.16.1"
"@sentry/utils" "5.16.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.16.1.tgz#e35d507a134a6ab4c572304dc1143b6bccfa9b45"
integrity sha512-Og4zxp0lM9yS6TyKbZ5lQR94f/fNOalodm71Dk4qfBWi0OzfFCVpO4fPOhHtbXEsvMNg5xh0Pe8ezqX3CZ3hTw==
dependencies:
"@sentry/types" "5.16.1"
"@sentry/utils" "5.16.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.16.1.tgz#71d16c20a0a396ab3da07b19cb444b4459fd2b11"
integrity sha512-RCwEKLneV5BQlv1MEmsCR3I5jajHgVGusBgwGgnFv+4Cn4cNC7OHWH4QbuZ3IHOEHJl7YS074BeluM+7jn0+Tw==
dependencies:
"@sentry/hub" "5.16.1"
"@sentry/types" "5.16.1"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.16.1.tgz#ba69dbf096d121b4197fdd54c35ac941b53d0b6a"
integrity sha512-uERNhBdsiWvWG7qTC9QVsvFmOSL8rFfy8usEXeH3l4oCQao9TvGUvXJv6gRfiWmoiJZ1A0608Lj15CORygdbng==

"@sentry/[email protected]":
version "5.16.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.16.1.tgz#c663858ab04bbb0cba6660fb37a4ccdb30cc2ec8"
integrity sha512-hn2jTc6ZH1lXGij7yqkV6cGhEYxsdjqB5P4MjfrRHB5bk5opY9R89bsAhs1rpanTdwv6Ul0ieR1z18gdIgUf0g==
dependencies:
"@sentry/types" "5.16.1"
tslib "^1.9.3"

"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
Expand Down Expand Up @@ -15823,6 +15887,11 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.2.tgz#9c79d83272c9a7aaf166f73915c9667ecdde3cc9"
integrity sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==

tslib@^1.9.3:
version "1.13.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==

tsutils@^3.17.1:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
Expand Down

0 comments on commit a9881e6

Please sign in to comment.