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

/sentry-reliability-patterns

@0d57af8
Run it yourself

Build reliable Sentry integrations with graceful degradation, circuit breakers, and offline queuing. Use when implementing fault-tolerant error tracking, handling SDK initialization failures, building retry logic for Sentry transports, or ensuring apps survive Sentry outages. Trigger with "sentry reliability", "sentry circuit breaker", "sentry offline queue", "sentry graceful degradation", "sentry failover", or "resilient sentry setup".

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesdual-write-pattern.md

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

Dual-Write Pattern

For mission-critical errors, write to multiple destinations simultaneously. Use Promise.allSettled so one destination's failure never blocks the others.

TypeScript Implementation

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

interface ErrorDestination {
  name: string;
  capture: (error: Error, context: Record<string, unknown>) => void | Promise<void>;
}

const destinations: ErrorDestination[] = [
  {
    name: 'sentry',
    capture: (error, context) => {
      Sentry.withScope((scope) => {
        scope.setLevel('fatal');
        scope.setContext('critical', context);
        Sentry.captureException(error);
      });
    },
  },
  {
    name: 'structured-log',
    capture: (error, context) => {
      console.error(JSON.stringify({
        level: 'FATAL',
        error: error.message,
        stack: error.stack,
        context,
        timestamp: new Date().toISOString(),
      }));
    },
  },
  {
    name: 'file-log',
    capture: (error, context) => {
      const fs = require('fs');
      fs.appendFileSync(
        '/var/log/app-errors.log',
        JSON.stringify({
          error: error.message,
          context,
          timestamp: new Date().toISOString(),
        }) + '\n',
      );
    },
  },
];

/** Capture a critical error to all destinations in parallel. */
async function captureCritical(
  error: Error,
  context: Record<string, unknown>,
): Promise<void> {
  const results = await Promise.allSettled(
    destinations.map(async (dest) => {
      try {
        await dest.capture(error, context);
      } catch (e) {
        console.error(`[DualWrite] ${dest.name} failed:`, e);
        throw e;
      }
    }),
  );

  const failed = results
    .map((r, i) => (r.status === 'rejected' ? destinations[i].name : null))
    .filter(Boolean);

  if (failed.length > 0) {
    console.warn(`[DualWrite] Failed destinations: ${failed.join(', ')}`);
  }
}

Python Implementation

import json
import time
import sentry_sdk
from concurrent.futures import ThreadPoolExecutor, as_completed

def capture_critical(error: Exception, context: dict) -> None:
    """Send critical error to all destinations in parallel."""
    def to_sentry():
        with sentry_sdk.push_scope() as scope:
            scope.set_level("fatal")
            scope.set_context("critical", context)
            sentry_sdk.capture_exception(error)

    def to_structured_log():
        print(json.dumps({
            "level": "FATAL",
            "error": str(error),
            "context": context,
            "timestamp": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
        }))

    with ThreadPoolExecutor(max_workers=3) as pool:
        futures = {
            pool.submit(to_sentry): "sentry",
            pool.submit(to_structured_log): "structured-log",
        }
        for future in as_completed(futures):
            name = futures[future]
            try:
                future.result()
            except Exception as e:
                print(f"[DualWrite] {name} failed: {e}")

Tons of Skills by Intent Solutions

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 production-ready code patterns for building resilient Sentry integrations with features like circuit breakers and offline queuing. No security issues 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
ReadWriteEditGrepBash(node:*)Bash(pip:*)Bash(python*:*)
Other metadata
tags
[
  "saas",
  "sentry",
  "reliability",
  "resilience",
  "circuit-breaker",
  "offline-queue",
  "graceful-degradation"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/sentry-reliability-patterns