-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #985 from iterative/sentry-integration-part-two
Revert "Revert "Add sentry""
- Loading branch information
Showing
5 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* eslint-env node */ | ||
|
||
const withSourceMaps = require('@zeit/next-source-maps') | ||
|
||
const settings = withSourceMaps({ | ||
webpack(config) { | ||
return config | ||
}, | ||
env: { | ||
SENTRY_DSN: process.env.SENTRY_DSN | ||
} | ||
}) | ||
|
||
module.exports = settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* global process */ | ||
|
||
import React from 'react' | ||
import App from 'next/app' | ||
import * as Sentry from '@sentry/browser' | ||
|
||
Sentry.init({ | ||
dsn: process.env.SENTRY_DSN | ||
}) | ||
|
||
class MyApp extends App { | ||
static async getInitialProps({ Component, ctx }) { | ||
let pageProps = {} | ||
|
||
if (Component.getInitialProps) { | ||
pageProps = await Component.getInitialProps(ctx) | ||
} | ||
|
||
return { pageProps } | ||
} | ||
|
||
componentDidCatch(error, errorInfo) { | ||
Sentry.withScope(scope => { | ||
Object.keys(errorInfo).forEach(key => { | ||
scope.setExtra(key, errorInfo[key]) | ||
}) | ||
|
||
Sentry.captureException(error) | ||
}) | ||
|
||
super.componentDidCatch(error, errorInfo) | ||
} | ||
|
||
render() { | ||
const { Component, pageProps } = this.props | ||
|
||
return <Component {...pageProps} /> | ||
} | ||
} | ||
|
||
export default MyApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1094,6 +1094,58 @@ | |
dependencies: | ||
any-observable "^0.3.0" | ||
|
||
"@sentry/browser@^5.12.1": | ||
version "5.12.1" | ||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.12.1.tgz#dc1f268595269fb7277f55eb625c7e92d76dc01b" | ||
integrity sha512-Zl7VdppUxctyaoqMSEhnDJp2rrupx8n8N2n3PSooH74yhB2Z91nt84mouczprBsw3JU1iggGyUw9seRFzDI1hw== | ||
dependencies: | ||
"@sentry/core" "5.12.0" | ||
"@sentry/types" "5.12.0" | ||
"@sentry/utils" "5.12.0" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "5.12.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.12.0.tgz#d6380c4ef7beee5f418ac1d0e5be86a2de2af449" | ||
integrity sha512-wY4rsoX71QsGpcs9tF+OxKgDPKzIFMRvFiSRcJoPMfhFsTilQ/CBMn/c3bDtWQd9Bnr/ReQIL6NbnIjUsPHA4Q== | ||
dependencies: | ||
"@sentry/hub" "5.12.0" | ||
"@sentry/minimal" "5.12.0" | ||
"@sentry/types" "5.12.0" | ||
"@sentry/utils" "5.12.0" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "5.12.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.12.0.tgz#5e8c8f249f5bdbeb8cc4ec02c2ccc53a67f2cc02" | ||
integrity sha512-3k7yE8BEVJsKx8mR4LcI4IN0O8pngmq44OcJ/fRUUBAPqsT38jsJdP2CaWhdlM1jiNUzUDB1ktBv6/lY+VgcoQ== | ||
dependencies: | ||
"@sentry/types" "5.12.0" | ||
"@sentry/utils" "5.12.0" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "5.12.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.12.0.tgz#2611e2aa520c1edb7999e6de51bd65ec66341757" | ||
integrity sha512-fk73meyz4k4jCg9yzbma+WkggsfEIQWI2e2TWfYsRGcrV3RnlSrXyM4D91/A8Bjx10SNezHPUFHjasjlHXOkyA== | ||
dependencies: | ||
"@sentry/hub" "5.12.0" | ||
"@sentry/types" "5.12.0" | ||
tslib "^1.9.3" | ||
|
||
"@sentry/[email protected]": | ||
version "5.12.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.12.0.tgz#5367e53c74261beea01502e3f7b6f3d822682a31" | ||
integrity sha512-aZbBouBLrKB8wXlztriIagZNmsB+wegk1Jkl6eprqRW/w24Sl/47tiwH8c5S4jYTxdAiJk+SAR10AAuYmIN3zg== | ||
|
||
"@sentry/[email protected]": | ||
version "5.12.0" | ||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.12.0.tgz#62967f934a3ee6d21472eac0219084e37225933e" | ||
integrity sha512-fYUadGLbfTCbs4OG5hKCOtv2jrNE4/8LHNABy9DwNJ/t5DVtGqWAZBnxsC+FG6a3nVqCpxjFI9AHlYsJ2wsf7Q== | ||
dependencies: | ||
"@sentry/types" "5.12.0" | ||
tslib "^1.9.3" | ||
|
||
"@types/babel__core@^7.1.0": | ||
version "7.1.3" | ||
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" | ||
|
@@ -1345,6 +1397,11 @@ | |
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" | ||
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== | ||
|
||
"@zeit/next-source-maps@^0.0.3": | ||
version "0.0.3" | ||
resolved "https://registry.yarnpkg.com/@zeit/next-source-maps/-/next-source-maps-0.0.3.tgz#d62e93b4f5ccdd542c8530d21f60dd2757d98e3c" | ||
integrity sha512-gFDf7yQI8r/fdzTKJG9cp0rhKscRJWs/uebhScj8nZINT16kPTVm23JAi5EivO5pAJmHGzT1A8dwxAhTX0liNw== | ||
|
||
abab@^2.0.0: | ||
version "2.0.3" | ||
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" | ||
|
@@ -8530,7 +8587,7 @@ ts-pnp@^1.1.2: | |
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.5.tgz#840e0739c89fce5f3abd9037bb091dbff16d9dec" | ||
integrity sha512-ti7OGMOUOzo66wLF3liskw6YQIaSsBgc4GOAlWRnIEj8htCxJUxskanMUoJOD6MDCRAXo36goXJZch+nOS0VMA== | ||
|
||
tslib@^1.9.0: | ||
tslib@^1.9.0, tslib@^1.9.3: | ||
version "1.10.0" | ||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" | ||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== | ||
|