Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

sentry-reliability-patterns哨兵可靠性模式

Agent Skill

sentry-reliability-patterns 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

696

周安装

29

GitHub Stars

2,115

下载量

232
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sentry-reliability-patterns(哨兵可靠性模式)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/sentry-reliability-patterns
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill sentry-reliability-patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill sentry-reliability-patterns

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理,提升开发协作效率。
  • 可结合来源仓库和原始 README 继续核验具体用法,确保功能匹配实际需求。
  • 安装命令:npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill sentry-reliability-patterns。
  • 建议确认权限范围和维护状态,以及是否会触发联网、命令执行或文件读写操作。

SKILL.md

Sentry Reliability Patterns

Overview

Build Sentry integrations that never take your application down via three pillars: safe initialization with graceful degradation, a circuit breaker that stops hammering Sentry when unreachable, and an offline event queue that buffers errors during outages. Every pattern prioritizes application uptime over telemetry completeness.

Prerequisites

  • @sentry/node v8+ (TypeScript) or sentry-sdk v2+ (Python)
  • A valid Sentry DSN from project settings at sentry.io
  • A fallback logging destination decided (console, file, or external logger)
  • Understanding of your application shutdown lifecycle (signal handlers, container orchestration)

Instructions

Step 1 — Safe Initialization with Graceful Degradation

Wrap Sentry.init() in try/catch so an invalid DSN, network error, or SDK bug never crashes the app. Track initialization state with a boolean flag. Protect beforeSend callbacks with their own error boundary.

Create lib/sentry-safe.ts with initSentrySafe() and captureError(). See graceful-degradation.md for full implementation.

Key rules:

  • Never let Sentry.init() crash the process — wrap in try/catch, set sentryAvailable = false on failure
  • Verify client creation with Sentry.getClient() — invalid DSNs silently produce no client
  • Always log errors locally as baseline before attempting Sentry capture
  • Wrap user-supplied beforeSend hooks in nested try/catch — return raw event on hook failure

Step 2 — Circuit Breaker for Sentry Outages

When Sentry is unreachable, continued attempts waste resources and add latency. Track consecutive failures and trip open after a threshold. After cooldown, enter half-open state and send a single probe.

Implement SentryCircuitBreaker class with closed/open/half-open states. See circuit-breaker-pattern.md for full implementation. Expose state via health-checks.md endpoint.

Key rules:

  • Default: 5 failures to trip open, 60-second cooldown before half-open probe
  • In open state, skip Sentry calls entirely and log to fallback
  • On half-open success, reset to closed with zero failure count
  • Expose getStatus() for health check endpoints and monitoring dashboards

Step 3 — Offline Queue, Custom Transport, and Graceful Shutdown

Buffer events when network is unavailable and replay on reconnect. Use bounded file-based queue to survive restarts. Pair with signal handlers that flush via Sentry.close() before process exit.

Implement three modules:

Key rules:

  • Cap offline queue at 1000 events, evict oldest when full
  • Drain queue on startup and when connectivity restores
  • Call Sentry.close(timeout) before process.exit() — without it, in-flight events are silently dropped
  • For critical errors, use dual-write-pattern.md to send to multiple destinations via Promise.allSettled

Output

  • Safe init wrapper catching SDK failures, starting app in degraded mode
  • captureError() with automatic fallback to local logging
  • Circuit breaker stopping sends after repeated failures, self-healing after cooldown
  • Health check endpoint exposing SDK status and circuit breaker state
  • File-based offline queue buffering events during outages, draining on reconnect
  • Signal handlers flushing in-flight events before process exit
  • Custom transport with exponential-backoff retry logic

Error Handling

ErrorCauseSolution
App crashes on Sentry.init()Invalid DSN or SDK bugWrap in try/catch via initSentrySafe()
Events lost on SIGTERMNo Sentry.close() before exitRegister signal handlers with Sentry.close(2000)
Sentry outage cascades latencyEvery error path hits Sentry HTTPCircuit breaker trips after 5 failures
Events lost during network blipSDK drops events silentlyRetry transport + offline queue
Silent event lossSDK fails without throwingHealth check probes with captureMessage + flush
Queue grows unboundedNever drained, Sentry permanently downCap at 1000 events, drain on startup
beforeSend crashes pipelineUser hook throwsNested try/catch, return raw event

See errors.md for extended troubleshooting.

Examples

See examples.md for complete TypeScript and Python integration examples including full-stack wiring of all three patterns.

Resources

Next Steps

  • Emit circuit breaker state changes to observability platform (Datadog, Prometheus) for outage alerting
  • Set up periodic drainQueue() via setInterval (Node) or cron (Python) instead of startup-only
  • Apply retry transport pattern to Python via sentry_sdk.init(transport=...) parameter
  • Test failure modes in staging — simulate Sentry failures with beforeSend to verify circuit breaker behavior
  • Add dual-write for P0/fatal errors to secondary destinations (CloudWatch, PagerDuty)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.22%
按下载量换算82

Claude

33.8%
按下载量换算78

Cursor

19.13%
按下载量换算44

Gemini CLI

9.72%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills