From ffe411c0b1694fbd44866afabbbad1f4752f4075 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 16 Jan 2021 10:59:54 -0800 Subject: [PATCH] Add Sentry error logging + privacy statement My main reason for adding this now is that I'm getting some scattered reports of things not displaying correctly, and I want to start gathering some browser data on that... I recently confirmed that animations work on iOS (at least one did!), which was going to be my guess of what was breaking... --- package.json | 2 + src/app/App.js | 13 +++++++ src/app/PrivacyPolicyPage.js | 10 +++++ yarn.lock | 75 ++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) diff --git a/package.json b/package.json index 0f06378..085392f 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "@emotion/styled": "^11.0.0", "@loadable/component": "^5.12.0", "@sendgrid/mail": "^7.2.6", + "@sentry/react": "^5.30.0", + "@sentry/tracing": "^5.30.0", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", diff --git a/src/app/App.js b/src/app/App.js index 3c1635a..e638510 100644 --- a/src/app/App.js +++ b/src/app/App.js @@ -10,6 +10,8 @@ import { useLocation, } from "react-router-dom"; import loadable from "@loadable/component"; +import * as Sentry from "@sentry/react"; +import { Integrations } from "@sentry/tracing"; import { useAuth0 } from "@auth0/auth0-react"; import buildApolloClient from "./apolloClient"; @@ -50,6 +52,17 @@ const theme = extendTheme({ }, }); +Sentry.init({ + dsn: + "https://c55875c3b0904264a1a99e5b741a221e@o506079.ingest.sentry.io/5595379", + autoSessionTracking: true, + integrations: [new Integrations.BrowserTracing()], + + // I'm figuring our traffic is low enough that 100% sample rate is fine. + // Let's see if we hit any usage limits! + tracesSampleRate: 1.0, +}); + /** * App is the entry point of our application. There's not a ton of exciting * stuff happening here, mostly just setting up some globals and theming! diff --git a/src/app/PrivacyPolicyPage.js b/src/app/PrivacyPolicyPage.js index c234e9b..e2d4382 100644 --- a/src/app/PrivacyPolicyPage.js +++ b/src/app/PrivacyPolicyPage.js @@ -93,6 +93,16 @@ function PrivacyPolicyPage() { Here's their data policy.

+

+ We also use a service called Sentry{" "} + to track errors. When you encounter an error on our site, we send a + copy of it to our Sentry account, to help us debug it later. This + might sometimes include personal data, but Sentry will only share it + with us.{" "} + + Here's their data policy. + +

We also use Vercel and{" "} Fastly for web hosting. They diff --git a/yarn.lock b/yarn.lock index 5955232..eb5fef8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3591,6 +3591,81 @@ "@sendgrid/client" "^7.2.6" "@sendgrid/helpers" "^7.2.6" +"@sentry/browser@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.30.0.tgz#c28f49d551db3172080caef9f18791a7fd39e3b3" + integrity sha512-rOb58ZNVJWh1VuMuBG1mL9r54nZqKeaIlwSlvzJfc89vyfd7n6tQ1UXMN383QBz/MS5H5z44Hy5eE+7pCrYAfw== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/react@^5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-5.30.0.tgz#320e05f766b6a26faefa8d76d1101fd50c69f541" + integrity sha512-dvn4mqCgbeEuUXEGp5P9PaW5j4GWTFUSdx/yG8f9IxNZv5zM+7otjog9ukrubFZvlxVxD/PrIxK0MhadfFY/Dw== + dependencies: + "@sentry/browser" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + hoist-non-react-statics "^3.3.2" + tslib "^1.9.3" + +"@sentry/tracing@^5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + "@sheerun/mutationobserver-shim@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25"