Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

api-observability-axiom-pino-sentryAPI observability axiom pino Sentry 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

269

周安装

11

GitHub Stars

5

下载量

87
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:api-observability-axiom-pino-sentry(API observability axiom pino Sentry 搜索)
来源仓库:https://github.com/agents-inc/skills
仓库路径:skills/api-observability-axiom-pino-sentry
安装命令:
npx skills add https://github.com/agents-inc/skills --skill api-observability-axiom-pino-sentry
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/agents-inc/skills --skill api-observability-axiom-pino-sentry

简介

构建结构化日志追踪与异常监控体系。

  • 采用 Pino 日志库配合 Axiom 告警系统和 Sentry 错误边界。
  • 强制要求所有日志携带关联 ID 实现请求链路追踪。
  • 安装方式:通过 GitHub 仓库添加,命令为 npx skills add https://github.com/agents-inc/skills --skill api-observability-axiom-pino-sentry。
  • 适用宿主包括 Codex、Claude、Cursor 和 Gemini CLI。

SKILL.md

Observability Patterns (Logging, Tracing, Error Handling)

Quick Guide: Structured logging with Pino (debug/info/warn/error). Correlation IDs for request tracing. Sentry error boundaries in React. Attach user context after auth. Filter expected errors (404s). Create Axiom monitors for alerts.

<critical_requirements>

CRITICAL: Before Using This Skill

All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering, import type, named constants)

(You MUST include correlation ID in ALL log statements for request tracing)

(You MUST use structured logging with required fields: level, message, correlationId, timestamp)

(You MUST filter expected errors (404, validation) from Sentry to avoid quota waste)

(You MUST attach user context to Sentry AFTER authentication completes)

(You MUST use child loggers with context instead of repeating fields in every log call)

</critical_requirements>


Auto-detection: log, logger, pino, Sentry, error boundary, correlation ID, trace, span, observability, monitoring, alerting

When to use:

  • Adding logging to new feature code
  • Implementing error handling patterns
  • Setting up request tracing with correlation IDs
  • Creating custom traces and spans for performance debugging
  • Configuring Sentry error boundaries in React components
  • Creating Axiom monitors and alerts

When NOT to use:

  • Initial project setup and dependency installation (one-time setup; follow official docs)
  • Framework-specific configuration files (follow framework SDK docs)

Key patterns covered:

  • Log levels decision tree (when to use debug/info/warn/error)
  • Structured logging with required fields
  • Correlation IDs: generating, propagating, attaching to logs
  • Custom traces/spans with OpenTelemetry
  • Sentry error boundaries in React
  • Attaching user context to Sentry after auth
  • Creating Axiom monitors and alerts
  • Filtering noise (expected errors like 404s)
  • Performance monitoring patterns
  • Debugging guide: tracing a request through the system

Detailed Resources:

Extended Examples:


Philosophy

Good observability answers three questions:

  1. What happened? (Structured logs with context)
  2. Why did it happen? (Error tracking with stack traces)
  3. How do I find it? (Correlation IDs linking related events)

Logging should be intentional, not defensive. Every log statement should answer a specific question you might ask when debugging. Avoid logging "just in case" - it creates noise that makes real issues harder to find.


Core Patterns

Pattern 1: Log Levels Decision Tree

Choose the appropriate log level based on the situation.

What are you logging?
├─ Development-only debugging info?
│   └─ debug (filtered in production)
├─ Normal operation events?
│   ├─ Request started/completed → info
│   ├─ User action completed → info
│   └─ Background job finished → info
├─ Something unexpected but recoverable?
│   ├─ Retry attempt → warn
│   ├─ Fallback used → warn
│   └─ Deprecation notice → warn
└─ Something that needs attention?
    ├─ Unhandled exception → error
    ├─ External service failure → error
    └─ Data integrity issue → error

Level Guidelines:

LevelProductionWhen to Use
debugFilteredDevelopment debugging, verbose tracing
infoVisibleNormal operations, request lifecycle, user actions
warnVisibleRecoverable issues, retries, fallbacks
errorVisible + AlertUnrecoverable issues, failures, exceptions

For code examples, see examples/core.md.


Pattern 2: Structured Logging with Required Fields

Every log statement should include structured context for searchability.

Required Fields:

FieldTypePurpose
correlationIdstringLinks all logs from same request
servicestringIdentifies the service (api, web, worker)
operationstringWhat action is being performed
userIdstring?User performing the action (if authenticated)
durationnumber?Time taken in milliseconds (for completed operations)

For code examples, see examples/core.md.


Pattern 3: Correlation IDs for Request Tracing

Generate and propagate correlation IDs to trace requests across services.

Key Components:

  1. Correlation ID Middleware - Generates/extracts correlation ID from headers
  2. Request Logger Middleware - Creates request-scoped logger with correlation context
  3. Route Handler Usage - Child loggers inherit correlation ID automatically

Modern Alternative: AsyncLocalStorage + Mixin

For larger applications, use AsyncLocalStorage with Pino's mixin option for automatic context injection without manual child logger creation in every handler.

For implementation examples of both approaches, see examples/correlation-ids.md.


Pattern 4: Custom Traces and Spans with OpenTelemetry

Add custom instrumentation for performance debugging.

Key Utilities:

  • withSpan() - Wrap async operations in traced spans
  • createSpan() - Create simple spans for synchronous operations

For code examples, see examples/tracing.md.


Pattern 5: Sentry Error Boundaries in React

Catch and report React component errors with recovery capability.

Key Components:

  1. ErrorBoundary - Class component for catching render errors
  2. global-error.tsx - SSR framework global error handler
  3. Feature-level boundaries - Wrap feature sections with custom fallbacks

For implementation examples, see examples/error-boundaries.md.


Pattern 6: Attaching User Context to Sentry

Add user information to Sentry after authentication for better debugging.

Key Functions:

  • setSentryUser() - Call after successful authentication
  • clearSentryUser() - Call on logout
  • setSentryContext() - Add additional context per-feature

For code examples, see examples/sentry-config.md.


Pattern 7: Filtering Expected Errors

Prevent expected errors from polluting Sentry quota and alerts.

Filtering Strategies:

  1. beforeSend hook - Filter by error message patterns
  2. HTTP status filtering - Skip 404, 401, 403
  3. beforeBreadcrumb hook - Remove noisy console.log breadcrumbs

For configuration examples, see examples/sentry-config.md.


Pattern 8: Creating Axiom Monitors and Alerts

Set up proactive monitoring for production issues.

Monitor Types:

  1. Error Rate Monitor - Alert when error rate > 1%
  2. Latency Monitor - Alert when P95 > 2 seconds
  3. Specific Error Monitor - Alert on database connection errors

For APL query examples, see examples/axiom.md.


Pattern 9: Performance Monitoring Patterns

Track and optimize slow operations.

Tracking Utilities:

  • trackedQuery() - Wrap database queries with performance tracking
  • trackedApiCall() - Wrap external API calls with performance tracking

For implementation examples, see examples/performance.md.


Pattern 10: Debugging Guide - Tracing a Request

How to trace a request through the system when debugging.

Steps:

  1. Get correlation ID from response headers, Sentry, or user report
  2. Search Axiom for all logs with that correlation ID
  3. Analyze request flow with timeline view
  4. Find related errors and stack traces
  5. Check Sentry for additional context

For detailed APL queries and checklist, see examples/axiom.md.


<red_flags>

RED FLAGS

For comprehensive anti-patterns and red flags, see reference.md.

Quick Reference - High Priority Issues:

  • Missing correlation ID in logs - Impossible to trace requests
  • Using console.log instead of structured logger - Not searchable, no levels
  • Logging sensitive data - Security vulnerability
  • Not filtering expected errors in Sentry - Wastes quota, buries real issues
  • Error logs without stack traces - Can't debug without knowing where error occurred

</red_flags>


<critical_reminders>

CRITICAL REMINDERS

All code must follow project conventions in CLAUDE.md

(You MUST include correlation ID in ALL log statements for request tracing)

(You MUST use structured logging with required fields: level, message, correlationId, timestamp)

(You MUST filter expected errors (404, validation) from Sentry to avoid quota waste)

(You MUST attach user context to Sentry AFTER authentication completes)

(You MUST use child loggers with context instead of repeating fields in every log call)

Failure to follow these rules will result in untraceable requests, wasted Sentry quota, and impossible debugging.

</critical_reminders>

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.43%
按下载量换算30

Claude

27.79%
按下载量换算24

Cursor

18.08%
按下载量换算16

Gemini CLI

9.84%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills