Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/sentry-architecture-variants

@0d57af8
Run it yourself

Configure Sentry error tracking and performance monitoring for different application architectures. Use when setting up Sentry for monoliths, microservices, serverless functions, event-driven systems, frontend SPAs, mobile apps, or hybrid deployments. Trigger: "sentry monolith setup", "sentry microservices tracing", "sentry serverless lambda", "sentry event-driven kafka", "sentry react native", "sentry architecture pattern".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/sentry-architecture-variants

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesfrontend-spa-architecture.md

≈766 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Frontend SPA Architecture — Sentry Deep Dive

React Setup with @sentry/react

// src/instrument.ts — load before app mounts
import * as Sentry from '@sentry/react';
import { createBrowserRouter } from 'react-router-dom';

Sentry.init({
  dsn: process.env.REACT_APP_SENTRY_DSN,
  environment: process.env.NODE_ENV,
  release: process.env.REACT_APP_VERSION,
  tracesSampleRate: 0.1,
  replaysSessionSampleRate: 0.1,         // 10% of sessions recorded
  replaysOnErrorSampleRate: 1.0,         // 100% of error sessions recorded

  integrations: [
    Sentry.browserTracingIntegration(),  // auto-instruments page loads + XHR
    Sentry.replayIntegration({
      maskAllText: true,                 // PII-safe by default
      blockAllMedia: true,
    }),
  ],

  // Connect frontend spans to backend traces
  tracePropagationTargets: [
    'localhost',
    /^https:\/\/api\.yourapp\.com/,      // your API domain
  ],
});

// Route-based transactions with React Router v6+
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);

const router = sentryCreateBrowserRouter([
  { path: '/', element: <Home /> },
  { path: '/dashboard', element: <Dashboard /> },
  { path: '/settings', element: <Settings /> },
]);

// Error boundary captures React component errors
function App() {
  return (
    <Sentry.ErrorBoundary
      fallback={({ error }) => <ErrorPage error={error} />}
      showDialog                          // shows user feedback dialog
    >
      <RouterProvider router={router} />
    </Sentry.ErrorBoundary>
  );
}

Vanilla JS / Vue / Angular

Use @sentry/browser instead of @sentry/react:

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  integrations: [Sentry.browserTracingIntegration()],
  tracesSampleRate: 0.1,
  tracePropagationTargets: ['localhost', /^https:\/\/api\.yourapp\.com/],
});

Critical: tracePropagationTargets

The browser SDK will NOT attach sentry-trace/baggage headers to API requests unless the URL matches tracePropagationTargets. Without this, frontend-to-backend traces break.

// WRONG — no targets, no headers sent
Sentry.init({ dsn: '...' });

// CORRECT — headers sent to matching API domains
Sentry.init({
  dsn: '...',
  tracePropagationTargets: [
    'localhost',
    /^https:\/\/api\.yourapp\.com/,
  ],
});

Session Replay Configuration

Session Replay records DOM changes (not video) for error reproduction:

Sentry.init({
  integrations: [
    Sentry.replayIntegration({
      maskAllText: true,       // mask all text for PII safety
      blockAllMedia: true,     // block images/video
      maskAllInputs: true,     // mask form inputs
    }),
  ],
  replaysSessionSampleRate: 0.1,   // 10% of all sessions
  replaysOnErrorSampleRate: 1.0,   // 100% of sessions with errors
});

Tons of Skills by Intent Solutions | jeremylongshore.com

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides architectural guidance and code snippets for integrating Sentry error tracking and performance monitoring into various application types. No security issues or malicious patterns were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.51.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
compatibility
Designed for Claude Code
All 7 allowed tools
ReadWriteEditGrepGlobBash(node:*)Bash(npx:*)
Other metadata
tags
[
  "saas",
  "sentry",
  "serverless",
  "microservices",
  "architecture",
  "distributed-tracing",
  "lambda",
  "spa",
  "mobile"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/sentry-architecture-variants