Merge pull request #48 from project-error/feat/sentry

Feat: Added Sentry integration for exception metrics
This commit is contained in:
Taso authored and GitHub committed 2021-01-08 10:11:07 -05:00
commit a1f0d7a289
5 files changed
+112 -12

No files matched your search

+2 -1
View File
@@ -44,5 +44,6 @@
},
"divider": "rgba(255, 255, 255, 0.12)"
}
}
},
"SentryErrorMetrics": true
}
+25 -10
View File
@@ -1,13 +1,28 @@
import "@babel/polyfill";
import React from "react";
import ReactDOM from "react-dom";
import { HashRouter } from "react-router-dom";
import { RecoilRoot } from "recoil";
import '@babel/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import * as Sentry from '@sentry/react';
import { Integrations } from '@sentry/tracing';
import './main.css';
import Phone from './Phone';
import TwitterNotification from './apps/twitter/components/notification/TwitterNotification';
import { BankNotification } from './apps/bank/components/notification/BankNotification';
import PhoneConfig from './config/default.json';
import "./main.css";
import Phone from "./Phone";
import TwitterNotification from "./apps/twitter/components/notification/TwitterNotification";
import { BankNotification } from "./apps/bank/components/notification/BankNotification";
// Enable Sentry when config setting is true
if (PhoneConfig.SentryErrorMetrics) {
Sentry.init({
dsn:
'https://[email protected]/5581619',
autoSessionTracking: true,
integrations: [new Integrations.BrowserTracing()],
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
});
}
ReactDOM.render(
<HashRouter>
@@ -17,5 +32,5 @@ ReactDOM.render(
<Phone />
</RecoilRoot>
</HashRouter>,
document.getElementById("root")
document.getElementById('root')
);