Skip to content

Commit

Permalink
config: Configure Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Dec 5, 2023
1 parent 633cdfc commit 2e1d5e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions frontend/src/config/sentry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//...
import * as Sentry from "@sentry/react";


export const initSentry = () =>
Sentry.init({
dsn: "https://21d71c12f155fb5aae96a480ed35c473@o4506343330021376.ingest.sentry.io/4506343351320576",
integrations: [
new Sentry.BrowserTracing({
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
}),
new Sentry.Replay(),
],
// Performance Monitoring
tracesSampleRate: 0.1, // Capture 100% of the transactions
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});

export default initSentry;
5 changes: 5 additions & 0 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import "./index.css";
import React from "react";
import ReactDOM from "react-dom";
import App from "./components/App/App";
import { initSentry } from "./config/sentry";
import { initAudioListener } from "./util/audio";
import { initWebAudioListener } from "./util/webAudio";

// Init sentry
initSentry();

// Init audio listener
initAudioListener();
initWebAudioListener();


// Create app
ReactDOM.render(<App />, document.getElementById("root"));

Expand Down

0 comments on commit 2e1d5e9

Please sign in to comment.