Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

api-observability-setup-axiom-pino-sentryAPI observability 设置 axiom pino Sentry

Agent Skill

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

总安装

259

周安装

11

GitHub Stars

5

下载量

91
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

一站式部署 Pino + Axiom + Sentry 可观测性栈。

  • 自动配置 Next.js 项目的 withAxiom 与 withSentryConfig 包装器。
  • 支持 CI/CD 环境下源码映射文件自动上传功能。
  • 安装方式:通过 GitHub 仓库添加,命令为 npx skills add https://github.com/agents-inc/skills --skill api-observability-setup-axiom-pino-sentry。
  • 适用宿主包括 Codex、Claude、Cursor 和 Gemini CLI。

SKILL.md

Observability Setup (Pino + Axiom + Sentry)

Quick Guide: One-time project setup for observability. Install pino, next-axiom, @sentry/nextjs. Configure Axiom dataset + Vercel integration. Set up Sentry DSN and config files. Wrap next.config.ts with withAxiom then withSentryConfig. Add instrumentation.ts for runtime-specific Sentry init. Source maps are uploaded automatically when SENTRY_AUTH_TOKEN is set in CI.

Detailed Resources:

- examples/core.md - Dependencies, env vars, next.config.ts, instrumentation - examples/sentry-config.md - Sentry configuration files (client, server, edge) - examples/pino-logger.md - Pino logger setup with redaction - examples/axiom-integration.md - Web Vitals and dashboard queries - examples/ci-cd.md - GitHub Actions source maps upload - examples/health-check.md - Health check endpoints


<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 create separate Axiom datasets for each environment - development, staging, production)

(You MUST configure all three Sentry config files - sentry.client.config.ts, sentry.server.config.ts, sentry.edge.config.ts)

(You MUST add source maps upload to CI/CD - Sentry needs source maps for readable stack traces)

(You MUST install pino-pretty as a devDependency only - never use in production)

</critical_requirements>


Auto-detection: pino, next-axiom, @sentry/nextjs, Axiom, Sentry, observability setup, logging setup, error tracking setup, source maps, sentry.client.config, sentry.server.config, sentry.edge.config, withAxiom, withSentryConfig

When to use:

  • Setting up a new project that needs logging and error tracking
  • Adding observability to an existing project without it
  • Migrating from another logging/error tracking solution to Axiom + Sentry

When NOT to use:

  • Adding new log statements to existing code (ongoing usage, not initial setup)
  • Configuring alerts, monitors, or dashboards after initial setup
  • Debugging production issues with existing observability

Key patterns covered:

  • Dependency installation (Pino, next-axiom, @sentry/nextjs, pino-pretty)
  • Environment variables template (.env.example)
  • next.config.ts with withAxiom() and withSentryConfig() wrappers
  • Sentry configuration files (client, server, edge)
  • instrumentation.ts for Sentry initialization
  • GitHub Actions for source maps upload
  • Pino logger with development/production modes
  • Health check endpoints
  • Initial Axiom dashboard setup

Philosophy

Observability is not optional for production apps. Without logging and error tracking, debugging production issues becomes guesswork. The Pino + Axiom + Sentry stack provides:

  • Pino: Fast structured JSON logging (5x faster than Winston)
  • Axiom: Unified logs, traces, and metrics with Vercel integration
  • Sentry: Error tracking with source maps and release tracking

This skill covers one-time setup only. For ongoing usage patterns (log levels, structured fields, correlation IDs, alert configuration), use your observability usage skill.


Core Patterns

Pattern 1: Dependency Installation

Install all observability packages with correct dependency types.

# Production dependencies
npm install pino next-axiom @sentry/nextjs

# Development dependencies (pretty printing for local dev)
npm install -D pino-pretty

Why: pino-pretty as devDependency prevents production bundle bloat (~500KB), all core packages are production dependencies for runtime use.

For detailed code examples with good/bad comparisons, see examples/core.md.


Pattern 2: Environment Variables Template

Create .env.example with all required observability variables documented. Group by service, use comments to explain where to get each value, and maintain separate datasets per environment.

Key variables needed:

  • NEXT_PUBLIC_AXIOM_DATASET - Dataset name (e.g., myapp-dev, myapp-prod)
  • NEXT_PUBLIC_AXIOM_TOKEN - API token with ingest permission
  • NEXT_PUBLIC_SENTRY_DSN - Sentry DSN from project settings
  • SENTRY_AUTH_TOKEN - For source maps upload in CI
  • SENTRY_ORG / SENTRY_PROJECT - Organization and project slugs

For complete template with all variables, see examples/core.md.


Pattern 3: next.config.ts with withAxiom and withSentryConfig

Wrap Next.js config with withAxiom for logging integration, then withSentryConfig for source map handling.

Key configuration points:

  • withAxiom wraps first (inner), Sentry wraps outer
  • silent:!process.env.CI suppresses source map upload logs locally
  • Source maps are hidden by default in v9+ (no hideSourceMaps needed)
  • Use sourcemaps.deleteSourcemapsAfterUpload to clean up after upload
import { withSentryConfig } from "@sentry/nextjs";
import { withAxiom } from "next-axiom";

const nextConfig = {
  /* your config */
};

export default withSentryConfig(withAxiom(nextConfig), {
  org: process.env.SENTRY_ORG,
  project: process.env.SENTRY_PROJECT,
  authToken: process.env.SENTRY_AUTH_TOKEN,
  silent: !process.env.CI,
});

For complete configuration example, see examples/core.md.


Pattern 4: Sentry Configuration Files

Create all three Sentry config files for client, server, and edge runtimes.

Required files:

  • sentry.client.config.ts - Client-side with replay integration
  • sentry.server.config.ts - Server-side with local variables capture
  • sentry.edge.config.ts - Edge runtime with limited features

Key considerations:

  • Use named constants for sample rates
  • Environment-specific configuration (debug mode, sample rates)
  • Filter expected errors with beforeSend
  • v9+: hideSourceMaps and enableTracing removed, source maps hidden by default

For complete file templates, see examples/sentry-config.md.


Pattern 5: Instrumentation File

Create instrumentation.ts for proper Sentry initialization in Next.js. Uses dynamic imports to load the correct config for each runtime.

import * as Sentry from "@sentry/nextjs";

export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") {
    await import("./sentry.server.config");
  }

  if (process.env.NEXT_RUNTIME === "edge") {
    await import("./sentry.edge.config");
  }
}

// Next.js 15+ error handling hook
export const onRequestError = Sentry.captureRequestError;

Why: Dynamic imports prevent loading wrong config for runtime, onRequestError hook captures Server Component errors automatically (Next.js 15+).


Pattern 6: Web Vitals Component

Add <AxiomWebVitals /> component to root layout for automatic Core Web Vitals (LCP, INP, CLS) reporting to Axiom.

Note: Web Vitals are only sent from production deployments, not local development.

For implementation example, see examples/axiom-integration.md.


Pattern 7: GitHub Actions Source Maps Upload

Configure CI/CD to upload source maps to Sentry on deployment. Key requirements:

  • SENTRY_AUTH_TOKEN in build environment enables automatic upload
  • Use getsentry/action-release@v3 for release creation
  • Tie version to git SHA for release tracking

For complete workflow template, see examples/ci-cd.md.


Pattern 8: Health Check Endpoint

Add health check endpoints that integrate with your observability stack:

  • Shallow check - Fast response for load balancer probes, includes version for Sentry release correlation
  • Deep check - Verifies dependencies, logs failures via Pino for Axiom dashboard visibility

For implementation examples, see examples/health-check.md.


Pattern 9: Pino Logger Setup

Configure Pino with development/production modes:

  • Development: pino-pretty for human-readable output
  • Production: JSON for log aggregation ingestion
  • Base fields for context in every log
  • Redaction of sensitive fields

For complete configuration, see examples/pino-logger.md.


Pattern 10: Axiom Dashboard Setup

After setting up, create initial dashboards in Axiom:

  • Request volume per minute
  • Error rate percentage
  • Response time P95
  • Top errors
  • Web Vitals metrics

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


<decision_framework>

Decision Framework

See reference.md for complete decision trees:

  • Log Destinations: Where logs should go in each environment
  • Sentry vs Axiom for Errors: Which system handles which error types

</decision_framework>


<red_flags>

RED FLAGS

See reference.md for complete list.

High Priority:

  • Committing Axiom tokens or Sentry DSN to version control
  • Using pino-pretty in production
  • Missing source maps upload in CI
  • Same Axiom dataset for all environments

Common Mistakes:

  • Forgetting to wrap next.config.ts with withAxiom
  • Missing instrumentation.ts
  • Using removed Sentry options (hideSourceMaps, enableTracing, disableServerWebpackPlugin)
  • Hardcoding sample rates instead of named constants

</red_flags>


<critical_reminders>

CRITICAL REMINDERS

All code must follow project conventions in CLAUDE.md

(You MUST create separate Axiom datasets for each environment - development, staging, production)

(You MUST configure all three Sentry config files - sentry.client.config.ts, sentry.server.config.ts, sentry.edge.config.ts)

(You MUST add source maps upload to CI/CD - Sentry needs source maps for readable stack traces)

(You MUST install pino-pretty as a devDependency only - never use in production)

Failure to follow these rules will result in missing logs, unreadable errors, and security vulnerabilities.

</critical_reminders>

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.23%
按下载量换算32

Claude

29.35%
按下载量换算27

Cursor

19.48%
按下载量换算18

Gemini CLI

9.75%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills