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.

referencesmulti-tenant-architecture.md

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

Multi-Tenant Architecture — Sentry Deep Dive

Single Project with Tenant Tags

For most SaaS apps, one Sentry project with per-tenant tagging is sufficient.

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  tracesSampleRate: 0.1,

  beforeSend(event) {
    // Strip tenant-specific PII from all events
    if (event.request?.data) {
      event.request.data = '[Filtered]';
    }
    return event;
  },
});

// Middleware: set tenant context per request using withScope
app.use((req, res, next) => {
  const tenantId = req.headers['x-tenant-id'] || 'unknown';

  Sentry.withScope((scope) => {
    scope.setTag('tenant_id', tenantId);
    scope.setTag('tenant_plan', getTenantPlan(tenantId));  // 'free', 'pro', 'enterprise'
    scope.setUser({ id: `tenant:${tenantId}` });           // tenant, not individual user
    next();
  });
});

// Filter by tenant in Sentry dashboard:
// Issues → Search: tags.tenant_id:acme-corp
// Performance → Search: tags.tenant_plan:enterprise

Per-Tenant Projects (Enterprise Scale)

For regulated industries or large enterprise clients requiring data isolation:

Organization: mycompany
├── Project: platform-shared      # Platform-level errors
├── Project: tenant-acme          # ACME Corp errors
├── Project: tenant-globex        # Globex errors
└── Project: tenant-initech       # Initech errors
// Dynamic DSN routing per tenant
const tenantDSNs: Record<string, string> = {
  'acme': 'https://abc@sentry.io/1',
  'globex': 'https://def@sentry.io/2',
  'default': process.env.SENTRY_DSN!,
};

// Initialize with default DSN, route events per tenant
Sentry.init({
  dsn: tenantDSNs.default,
  beforeSend(event) {
    const tenantId = event.tags?.tenant_id;
    if (tenantId && tenantDSNs[tenantId]) {
      // Route to tenant-specific project
      event.dsn = tenantDSNs[tenantId];
    }
    return event;
  },
});

Scope Isolation Warning

Never use Sentry.setTag() at the global level for tenant data. Global tags persist across requests in Node.js (shared process), causing tenant data to leak between requests.

// WRONG — leaks between requests
app.use((req, res, next) => {
  Sentry.setTag('tenant_id', req.tenantId);  // global scope!
  next();
});

// CORRECT — isolated per request
app.use((req, res, next) => {
  Sentry.withScope((scope) => {
    scope.setTag('tenant_id', req.tenantId);  // scoped to this request
    next();
  });
});

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