feat(telemetry): implement glitchtip/sentry integration with smart proxy
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 10s
Build & Deploy / 🧪 QA (push) Failing after 2m43s
Build & Deploy / 🏗️ Build (push) Failing after 5m34s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

- Added Sentry/GlitchTip relay route handler
- Configured Sentry for client (with tunnel), server, and edge runtimes
- Refactored GlitchTip adapter to use official @sentry/nextjs SDK
- Fixed ComparisonRow type issues and Analytics Suspense bailout
- Integrated Sentry instrumentation into the boot sequence
This commit is contained in:
2026-02-16 23:09:50 +01:00
parent 2038b8fe47
commit 4db820214b
10 changed files with 152 additions and 78 deletions

View File

@@ -1,12 +1,12 @@
"use client";
import React, { useEffect } from "react";
import React, { useEffect, Suspense } from "react";
import { usePathname, useSearchParams } from "next/navigation";
import { ScrollDepthTracker } from "./analytics/ScrollDepthTracker";
import { getDefaultAnalytics } from "../utils/analytics";
import { getDefaultErrorTracking } from "../utils/error-tracking";
export const Analytics: React.FC = () => {
const AnalyticsInner: React.FC = () => {
const pathname = usePathname();
const searchParams = useSearchParams();
@@ -122,17 +122,23 @@ export const Analytics: React.FC = () => {
const adapter = analytics.getAdapter();
const scriptTag = adapter.getScriptTag ? adapter.getScriptTag() : null;
if (!scriptTag) return null;
// We use dangerouslySetInnerHTML to inject the script tag from the adapter
// This is safe here because the script URLs and IDs come from our own config/env
return (
<>
<ScrollDepthTracker />
<div
dangerouslySetInnerHTML={{ __html: scriptTag }}
style={{ display: "none" }}
/>
{scriptTag && (
<div
dangerouslySetInnerHTML={{ __html: scriptTag }}
style={{ display: "none" }}
/>
)}
</>
);
};
export const Analytics: React.FC = () => {
return (
<Suspense fallback={null}>
<AnalyticsInner />
</Suspense>
);
};

View File

@@ -8,7 +8,7 @@ import { cn } from "../../utils/cn";
interface ComparisonRowProps {
description?: string;
negativeLabel: string;
negativeText: React.ReactNode;
negativeText: string;
positiveLabel: string;
positiveText: React.ReactNode;
reverse?: boolean;