From cb50fb56891b1502b08e9edda21764501dc50010 Mon Sep 17 00:00:00 2001
From: Austin Poor <45295232+a-poor@users.noreply.github.com>
Date: Sat, 4 Jan 2025 13:21:25 -0800
Subject: [PATCH] Adds sentry profiling

---
 app/entry.client.tsx | 2 ++
 app/root.tsx         | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/app/entry.client.tsx b/app/entry.client.tsx
index 608efe2..80b19a9 100644
--- a/app/entry.client.tsx
+++ b/app/entry.client.tsx
@@ -8,6 +8,7 @@ Sentry.init({
   integrations: [
     Sentry.browserTracingIntegration(),
     Sentry.replayIntegration(),
+    Sentry.browserProfilingIntegration(),
   ],
   tracesSampleRate: 1.0,
   tracePropagationTargets: [
@@ -16,6 +17,7 @@ Sentry.init({
   ],
   replaysSessionSampleRate: 0.1,
   replaysOnErrorSampleRate: 1.0,
+  profilesSampleRate: 1.0,
 });
 
 startTransition(() => {
diff --git a/app/root.tsx b/app/root.tsx
index f911399..0575788 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -24,6 +24,13 @@ export const links: Route.LinksFunction = () => [
   { rel: "sitemap", type: "application/xml", title: "Sitemap", href: "sitemap.xml" },
 ];
 
+export function headers(_: Route.HeadersArgs) {
+  return {
+    'Document-Policy': 'js-profiling',
+  };
+}
+
+
 export async function loader({ request }: Route.LoaderArgs) {
   const cookieData = await themeCookie.parse(request.headers.get("Cookie") ?? "");
   let theme: Theme = "system";