-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sentry): Add sentry logging and stun server fallback (#24)
- Loading branch information
1 parent
c311ad9
commit a4e825a
Showing
13 changed files
with
150 additions
and
24 deletions.
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
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
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
4 changes: 3 additions & 1 deletion
4
src/client/analytics.js → src/client/third-party/google/analytics.js
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import config from '../../config' | ||
|
||
const analytics = () => { | ||
window.dataLayer = window.dataLayer || [] | ||
function gtag () { window.dataLayer.push(arguments) } | ||
gtag('js', new Date()) | ||
gtag('config', 'UA-117106220-2') | ||
gtag('config', config.analytics.google.propertyId) | ||
} | ||
|
||
export default analytics |
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,38 @@ | ||
// https://sentry.io | ||
import config from '../../config' | ||
import raven from 'raven-js' | ||
|
||
const sentryConfig = config.log.sentry | ||
const sentry = () => { | ||
if (sentryConfig.enabled) { | ||
console.log('Sentry is enabled') | ||
raven.config(sentryConfig.dsn, { | ||
environment: process.env.NODE_ENV || 'development', | ||
release: process.env.APP_VERSION, | ||
captureUnhandledRejections: sentryConfig.captureUnhandledRejections, | ||
autoBreadcrumbs: sentryConfig.autoBreadcrumbs, | ||
tags: sentryConfig.tags | ||
}).install() | ||
|
||
// Global sentry handlers | ||
window.captureException = (err, context) => { | ||
if (context) { | ||
raven.captureException(err, { extra: context }) | ||
} else { | ||
raven.captureException(err) | ||
} | ||
} | ||
window.captureBreadcrumb = breadcrumb => { | ||
raven.captureBreadcrumb(breadcrumb) | ||
} | ||
window.captureMessage = (message, options) => { | ||
raven.captureMessage(message, options) | ||
} | ||
} else { | ||
console.log('Sentry is disabled') | ||
window.captureException = err => {} | ||
window.captureBreadcrumb = breadcrumb => {} | ||
window.captureMessage = (message, options) => {} | ||
} | ||
} | ||
export default sentry |
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,18 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const Emoji = ({ emoji, label }) => ( | ||
<span | ||
role='img' | ||
aria-label={label} | ||
> | ||
{emoji} | ||
</span> | ||
) | ||
|
||
Emoji.propTypes = { | ||
emoji: PropTypes.any, | ||
label: PropTypes.string | ||
} | ||
|
||
export default Emoji |
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
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
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