Back to list
HoangNguyen0403

nestjs-observability

by HoangNguyen0403

A collection of Agent Skills Standard and Best Practice for Programming Languages, Frameworks that help our AI Agent follow best practies on frameworks and programming laguages

111🍴 40📅 Jan 23, 2026

SKILL.md


name: NestJS Observability description: Structured logging (Pino) and Prometheus metrics. metadata: labels: [nestjs, logging, monitoring, pino] triggers: files: ['main.ts', '**/*.module.ts'] keywords: [nestjs-pino, Prometheus, Logger, reqId]

Observability Standards

Priority: P1 (OPERATIONAL)

Logging, monitoring, and observability patterns for production applications.

  • Standard: Use nestjs-pino for high-performance JSON logging.
    • Why: Node's built-in console.log is blocking and unstructured.
  • Configuration:
    • Redaction: Mandatory masking of sensitive fields (password, token, email).
    • Context: Always inject Logger and set the context (LoginService).

Tracing (Correlation)

  • Request ID: Every log line must include a reqId (Request ID).
    • nestjs-pino handles this automatically using AsyncLocalStorage.
    • Propagation: Pass x-request-id to downstream microservices/database queries key to trace flows.

Metrics

  • Exposure: Use @willsoto/nestjs-prometheus to expose /metrics for Prometheus scraping.
  • Key Metrics:
    1. http_request_duration_seconds (Histogram)
    2. db_query_duration_seconds (Histogram)
    3. memory_usage_bytes (Gauge)

Health Checks

  • Terminus: Implement explicit logic for "Liveness" (I'm alive) vs "Readiness" (I can take traffic).
    • DB Check: TypeOrmHealthIndicator / PrismaHealthIndicator.
    • Memory Check: Fail if Heap > 300MB (prevent crash loops).

Score

Total Score

85/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

+5
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon