Communitygithub.com

YepAPI/skills

구조화된 로깅, Sentry 오류 추적, Axiom/Datadog 통합, 로그 레벨, 알림.

skills란 무엇인가요?

이 스킬은 Node.js 애플리케이션을 위한 포괄적인 로깅 및 모니터링 규칙과 패턴을 제공합니다. Pino를 사용한 구조화된 JSON 로깅, Sentry를 통한 오류 추적, Axiom 또는 Datadog으로의 로그 전송 등을 설정하는 방법을 명확히 설명합니다. 로그 레벨(오류, 경고, 정보, 디버그)을 정의하고, 요청 ID를 통한 로그 상관 관계, 민감한 데이터 자동 마스킹, 오류율 급증에 기반한 알림 설정 등 모범 사례를 안내합니다. 또한 건강 상태 확인 엔드포인트와 응답 시간 모니터링(p50, p95, p99)에 대한 지침을 제공하여 개발자가 프로덕션 환경에서 안정적이고 관찰 가능한 시스템을 구축하도록 돕습니다. Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있도록 설계되었습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/logging-monitoring

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

로깅 및 모니터링

규칙

  • 구조화된 로깅: timestamp, level, message, requestId, userId 필드를 포함한 JSON 형식 사용
  • 로그 레벨: error (중대한 오류), warn (성능 저하), info (비즈니스 이벤트), debug (개발 전용)
  • Node.js 로깅에는 Pino 사용 — 빠르고, 구조화되어 있으며, 기본적으로 JSON 형식
  • 오류 추적에는 Sentry 사용: 초기에 초기화하고, 처리되지 않은 예외를 캡처하며, 사용자 컨텍스트 및 breadcrumbs 추가
  • 요청 ID로 로그 상관 관계 설정 — 요청마다 UUID를 생성하고 모든 서비스 호출에 전달
  • 비밀번호, 토큰, 전체 신용카드 번호 등 민감한 정보를 절대 로깅하지 않음 — 민감한 필드는 자동 마스킹
  • 개별 오류가 아닌 오류율 급증에 대해 알림 — 임계값 사용 (예: 5분 이내 오류율 5% 초과)
  • Axiom/Datadog: OTLP 또는 네이티브 SDK를 통해 로그를 전송하고, 비즈니스 KPI에 대한 사용자 정의 메트릭 추가
  • 건강 상태 확인 엔드포인트: GET /health — { status: "ok" } 반환 및 DB 연결 상태 확인 포함
  • 응답 시간 p50, p95, p99 모니터링 — p95 성능 저하 시 알림

패턴

// Pino 구조화된 로깅
import pino from "pino";
const logger = pino({ level: process.env.LOG_LEVEL || "info" });

logger.info({ userId, action: "checkout", orderId }, "주문 완료");
logger.error({ err, requestId }, "결제 처리 실패");
// Sentry 초기화 (Next.js)
import * as Sentry from "@sentry/nextjs";
Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });

피해야 할 사항

  • 프로덕션 환경에서 console.log 사용 — 구조화된 로거를 사용하세요
  • 모든 요청 본문을 로깅하는 것 — 요약 정보를 로깅하고 전체 페이로드는 피하세요
  • 처리되지 않은 Promise rejection 무시 — 항상 캡처하세요
  • 시끄러운 알림으로 인한 알림 피로 — 임계값을 조정하고 유사한 오류를 그룹화하세요

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬