Add Datadog RUM (#28)

This commit is contained in:
John Wu
2021-04-05 17:15:07 -07:00
committed by GitHub
parent 113cc97fea
commit f796441f37
7 changed files with 65 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
jest.mock("../Contexts/UserContext");
jest.mock("../Contexts/FileUploadContext");
jest.mock("../Contexts/VehicleContext");
jest.mock("../../services/monitoring");
import { render, screen, cleanup, waitForElementToBeRemoved } from "@testing-library/react";
import { setToken } from "../Contexts/UserContext";

View File

@@ -5,6 +5,7 @@ import { StatusProvider } from "../Contexts/StatusContext";
import { CssBaseline } from "@material-ui/core";
import MenuDrawer from "../Layouts/MenuDrawer";
import SiteRoutes from "../Routes/SiteRoutes";
import {} from "../../services/monitoring";
function App() {
return (

View File

@@ -18,7 +18,7 @@ export default class ErrorBoundary extends Component {
if (this.state.hasError)
return (
<Typography variant="h3" align="center">
Oops. An React JS Error Occured.
Client-side Error Occured and Logged
</Typography>
);
return this.props.children;

View File

@@ -0,0 +1 @@
// no actual monitoring with mock

View File

@@ -0,0 +1,12 @@
import { datadogRum } from '@datadog/browser-rum';
datadogRum.init({
applicationId: '8ecd160c-ad5c-4e06-8d88-3a6b89833246',
clientToken: 'pubeb25449bb91773fc993855c7378e375a',
site: 'datadoghq.com',
service:'ota-portal',
// Specify a version number to identify the deployed version of your application in Datadog
// version: '1.0.0',
sampleRate: 100,
trackInteractions: true
});