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.

referencesserverless-architecture.md

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

Serverless Architecture — Sentry Deep Dive

AWS Lambda

import * as Sentry from '@sentry/aws-serverless';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.STAGE,
  tracesSampleRate: 0.1,
});

export const handler = Sentry.wrapHandler(async (event, context) => {
  Sentry.setTag('function', context.functionName);
  Sentry.setTag('region', process.env.AWS_REGION);

  // Cold start tracking
  const isColdStart = !global.__sentryWarm;
  global.__sentryWarm = true;
  Sentry.setTag('cold_start', String(isColdStart));

  const result = await processRequest(event);
  return { statusCode: 200, body: JSON.stringify(result) };
});
// wrapHandler auto-calls Sentry.flush() — do NOT call it yourself

Google Cloud Functions

import * as Sentry from '@sentry/google-cloud-serverless';

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

// HTTP function
export const httpHandler = Sentry.wrapHttpFunction(async (req, res) => {
  const result = await processRequest(req.body);
  res.json(result);
});

// CloudEvent function (Pub/Sub, Firestore triggers)
export const eventHandler = Sentry.wrapCloudEventFunction(async (event) => {
  await processEvent(event.data);
});

Critical: Flush Behavior

Platform Wrapper Auto-flush? Manual flush needed?
AWS Lambda Sentry.wrapHandler() Yes No — double-flush causes timeout
GCP Functions Sentry.wrapHttpFunction() Yes No
GCP CloudEvent Sentry.wrapCloudEventFunction() Yes No
Vercel @sentry/nextjs Yes No

Never call Sentry.flush() inside a wrapped serverless handler. The wrapper already handles it. Calling it manually causes the function to wait for two flush cycles, often exceeding the timeout.

Cold Start Spans

// Track cold start duration as a span
if (!global.__sentryWarm) {
  global.__sentryWarm = true;
  Sentry.startSpan({ name: 'lambda.cold_start', op: 'function' }, () => {
    // initialization code measured here
    initializeConnections();
    loadConfiguration();
  });
}

SQS Trigger with Trace Continuation

export const handler = Sentry.wrapHandler(async (event) => {
  for (const record of event.Records) {
    const attrs = record.messageAttributes;
    const sentryTrace = attrs?.['sentry-trace']?.stringValue;
    const baggage = attrs?.['baggage']?.stringValue;

    await Sentry.continueTrace({ sentryTrace, baggage }, () => {
      return Sentry.startSpan(
        { name: `sqs.process`, op: 'queue.process' },
        () => processRecord(record)
      );
    });
  }
});

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