Skip to content

Commit 2426fce

Browse files
authored
feat: Enable profiling for Spotlight itself (#720)
1 parent 88c5e72 commit 2426fce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/overlay/src/lib/instrumentation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default function initSentry(initialTab: string, options: Sentry.BrowserOp
2828
matchRoutes,
2929
}),
3030
Sentry.replayIntegration(),
31+
Sentry.browserProfilingIntegration(),
3132
];
3233
const hash = document.location.hash.slice(1);
3334
if (hash.startsWith('spotlight')) {

packages/sidecar/src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,11 @@ const fileServer = (filesToServe: Record<string, Buffer>) => {
229229
if (!Object.hasOwn(filesToServe, filePath)) {
230230
error404(req, res);
231231
} else {
232-
res.writeHead(200, { 'Content-Type': contentType });
232+
res.writeHead(200, {
233+
// Enable profiling in browser
234+
'Document-Policy': 'js-profiling,',
235+
'Content-Type': contentType,
236+
});
233237
res.end(filesToServe[filePath]);
234238
}
235239
};

0 commit comments

Comments
 (0)