src/skills/api-observability-axiom-pino-sentry/SKILL.md
Pino logging, Sentry error tracking, Axiom - structured logging with correlation IDs, error boundaries, performance monitoring, alerting
npx skillsauth add agents-inc/skills api-observability-axiom-pino-sentryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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>
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:
When NOT to use:
Key patterns covered:
Detailed Resources:
Extended Examples:
Good observability answers three questions:
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.
</philosophy>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:
| Level | Production | When to Use |
| ------- | --------------- | -------------------------------------------------- |
| debug | Filtered | Development debugging, verbose tracing |
| info | Visible | Normal operations, request lifecycle, user actions |
| warn | Visible | Recoverable issues, retries, fallbacks |
| error | Visible + Alert | Unrecoverable issues, failures, exceptions |
For code examples, see examples/core.md.
Every log statement should include structured context for searchability.
Required Fields:
| Field | Type | Purpose |
| --------------- | ------- | ----------------------------------------------------- |
| correlationId | string | Links all logs from same request |
| service | string | Identifies the service (api, web, worker) |
| operation | string | What action is being performed |
| userId | string? | User performing the action (if authenticated) |
| duration | number? | Time taken in milliseconds (for completed operations) |
For code examples, see examples/core.md.
Generate and propagate correlation IDs to trace requests across services.
Key Components:
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.
Add custom instrumentation for performance debugging.
Key Utilities:
withSpan() - Wrap async operations in traced spanscreateSpan() - Create simple spans for synchronous operationsFor code examples, see examples/tracing.md.
Catch and report React component errors with recovery capability.
Key Components:
For implementation examples, see examples/error-boundaries.md.
Add user information to Sentry after authentication for better debugging.
Key Functions:
setSentryUser() - Call after successful authenticationclearSentryUser() - Call on logoutsetSentryContext() - Add additional context per-featureFor code examples, see examples/sentry-config.md.
Prevent expected errors from polluting Sentry quota and alerts.
Filtering Strategies:
For configuration examples, see examples/sentry-config.md.
Set up proactive monitoring for production issues.
Monitor Types:
For APL query examples, see examples/axiom.md.
Track and optimize slow operations.
Tracking Utilities:
trackedQuery() - Wrap database queries with performance trackingtrackedApiCall() - Wrap external API calls with performance trackingFor implementation examples, see examples/performance.md.
How to trace a request through the system when debugging.
Steps:
For detailed APL queries and checklist, see examples/axiom.md.
</patterns><red_flags>
For comprehensive anti-patterns and red flags, see reference.md.
Quick Reference - High Priority Issues:
console.log instead of structured logger - Not searchable, no levels</red_flags>
<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>
development
Material Design component library for Vue 3
development
VitePress 1.x — Vue-powered static site generator for documentation sites, built on Vite
tools
Docusaurus 3.x documentation framework — site configuration, docs/blog plugins, sidebars, versioning, MDX, swizzling, and deployment
development
TanStack Form patterns - useForm, form.Field, validators, arrays, linked fields, createFormHook, type safety