Skip to content

Commit 78be8c0

Browse files
committed
feat: simple sentry implementation
1 parent e4501ec commit 78be8c0

File tree

6 files changed

+110
-13
lines changed

6 files changed

+110
-13
lines changed

.env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Sentry DSN
2+
VITE_SENTRY_DSN=
3+
14
# OpenID Connect Configuration for Onboarding API
25
OIDC_ISSUER=
36
OIDC_CLIENT_ID=

package-lock.json

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
"@fastify/cookie": "^11.0.2",
2525
"@fastify/env": "^5.0.2",
2626
"@fastify/http-proxy": "^11.1.2",
27-
"@fastify/sensible": "^6.0.3",
2827
"@fastify/secure-session": "^8.2.0",
28+
"@fastify/sensible": "^6.0.3",
2929
"@fastify/session": "^11.1.0",
3030
"@fastify/static": "^8.1.1",
3131
"@fastify/vite": "^8.1.3",
3232
"@hookform/resolvers": "^5.0.0",
33+
"@sentry/react": "^9.39.0",
3334
"@ui5/webcomponents": "^2.7.2",
3435
"@ui5/webcomponents-fiori": "^2.7.2",
3536
"@ui5/webcomponents-icons": "^2.7.2",
@@ -84,4 +85,4 @@
8485
"vite": "^6.3.4",
8586
"vitest": "^3.1.4"
8687
}
87-
}
88+
}

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function App() {
1414
if (frontendConfig && frontendConfig.landscape) {
1515
document.title = `[${frontendConfig.landscape}] MCP`;
1616
}
17-
}, []);
17+
}, [frontendConfig]);
1818

1919
if (auth.isLoading) {
2020
return <BusyIndicator active />;

src/AppRouter.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
HashRouter as Router,
3-
Navigate,
4-
Route,
5-
Routes,
6-
} from 'react-router-dom';
1+
import { HashRouter as Router, Navigate, Route, Routes } from 'react-router-dom';
72
import ControlPlaneView from './views/ControlPlanes/ControlPlaneView.tsx';
83
import ProjectListView from './views/ProjectList';
94
import ControlPlaneListView from './views/ControlPlanes/ControlPlaneListView.tsx';
@@ -18,10 +13,7 @@ function AppRouter() {
1813
<Routes>
1914
<Route path="/mcp" element={<GlobalProviderOutlet />}>
2015
<Route path="projects" element={<ProjectListView />} />
21-
<Route
22-
path="projects/:projectName"
23-
element={<ControlPlaneListView />}
24-
/>
16+
<Route path="projects/:projectName" element={<ControlPlaneListView />} />
2517
<Route
2618
path="projects/:projectName/workspaces/:workspaceName/mcps/:controlPlaneName/context/:contextName"
2719
element={<ControlPlaneView />}

src/mount.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { createRoot } from 'react-dom/client';
22
import { createApp } from './main.tsx';
3+
import * as Sentry from '@sentry/react';
4+
5+
Sentry.init({
6+
dsn: import.meta.env.VITE_SENTRY_DSN,
7+
// Setting this option to true will send default PII data to Sentry.
8+
// For example, automatic IP address collection on events
9+
sendDefaultPii: true,
10+
});
311

412
const root = createRoot(document.getElementById('root')!);
513
root.render(createApp());

0 commit comments

Comments
 (0)