Add Datadog RUM (#28)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
|
||||
1
src/services/__mocks__/monitoring.js
Normal file
1
src/services/__mocks__/monitoring.js
Normal file
@@ -0,0 +1 @@
|
||||
// no actual monitoring with mock
|
||||
12
src/services/monitoring.js
Normal file
12
src/services/monitoring.js
Normal 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
|
||||
});
|
||||
Reference in New Issue
Block a user