nestjs-observability
/nestjs-observability
Configure structured logging with Pino, Prometheus metrics, and health checks for NestJS services. Use when adding JSON logging, request tracing with correlation IDs, Prometheus metric endpoints, or liveness/readiness health checks.
- Author
- HoangNguyen0403 ↗
- Repository
- agent-skills-standard ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Configure structured logging with Pino, Prometheus metrics, and health checks for NestJS services. Use when adding JSON logging, request tracing with correlation IDs, Prometheus metric endpoints, or liveness/readiness health checks.
Original author description
Configure structured logging with Pino, Prometheus metrics, and health checks for NestJS services. Use when adding JSON logging, request tracing with correlation IDs, Prometheus metric endpoints, or liveness/readiness health checks.
How it works
- Priority: P1 (HIGH)
- Structured Logging (Pino)
- Tracing (Correlation)
- Metrics
- Health Checks
- Performance Headers (Dev Only)
- Anti-Patterns
SKILL.md preview
---
name: nestjs-observability
description: Configure structured logging with Pino, Prometheus metrics, and health checks for NestJS services. Use when adding JSON logging, request tracing with correlation IDs, Prometheus metric endpoints, or liveness/readiness health checks.
metadata:
triggers:
files:
- 'main.ts'
- '**/*.module.ts'
keywords:
- nestjs-pino
- Prometheus
- Logger
- reqId
---
# Observability Standards
## **Priority: P1 (HIGH)**
## Structured Logging (Pino)
Use `nestjs-pino` for high-performance, async JSON logging. Node's `console.log` blocking and unstructured.
See [implementation examples](references/example.md)
## Tracing (Correlation)
- **Request ID**: Every log line **must** include `reqId`. `nestjs-pino` handles this via `AsyncLocalStorage`.
- **Propagation**: Pass `x-request-id` to downstream microservices and database queries for end-to-end tracing.
## Metrics
Expose `/metrics` for Prometheus scraping using `@willsoto/nestjs-prometheus`.
See [implementation examples](references/example.md)
## Health Checks
- **Terminus**: Implement "Liveness" (I'm alive) vs "Readiness" (I can take traffic).
- **DB Check**: `TypeOrmHealthIndicator` / `PrismaHealthIndicator`.
- **Memory Check**: Fail readiness if Heap > 300MB to prevent crash loops.
## Performance Headers (Dev Only)
- `X-Response-Duration-Ms`, `X-DB-Execution-Ms`, `X-API-Overhead-Ms`
- Gate behind `ENABLE_PERFORMANCE_BENCHMARK` feature flag; never expose in production.
## Anti-Patterns
- **No console.log**: Use nestjs-pino for async, structured, JSON-formatted logging.
- **No missing reqId**: Propagate `x-request-id` header to all downstream services and queries.
- **No perf data in production by default**: Gate benchmarking behind `ENABLE_PERFORMANCE_BENCHMARK` flag.
Files in this package (3)
- SKILL.md 2 KB
- evals/evals.json 2 KB
- references/example.md 1 KB
Versions
The database has no other skills named nestjs-observability.
Database snapshot: 13.11.2026 · package version 66cdd005ec0e (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100go-observability
Structured logging, distributed tracing, metrics, and health checks for Go services. Covers slog, OpenTelemetry, Prometheus, and observability best practices. Use when: "add logging", "structured logs", "add tracing", "OpenTelemetry", "add metrics", "Prometheus",… - 90observability
Use when adding logging to services, setting up monitoring, creating alerts, debugging production issues, designing SLIs/SLOs, or implementing structured logging (Pino, Winston), metrics (Prometheus, DataDog, CloudWatch), or distributed tracing (OpenTelemetry). - 90FastAPI Observability
This skill should be used when the user asks to "add logging", "implement metrics", "add tracing", "configure Prometheus", "setup OpenTelemetry", "add health checks", "monitor API", or mentions observability, APM, monitoring, structured logging, distributed tracing, or Grafana.… - 100python-observability-ops
Observability patterns for Python applications. Triggers on: logging, metrics, tracing, opentelemetry, prometheus, observability, monitoring, structlog, correlation id. - 100observability
This skill should be used when the user asks about "observability", "logging", "metrics", "tracing", "monitoring", "structured logging", "log format", "log levels", "distributed tracing", "OpenTelemetry", "health checks", or needs guidance on implementing observability and monitoring requirements. - 95effect-observability
Implement structured logging, distributed tracing, and metrics in Effect applications. Use this skill when configuring loggers, adding spans/tracing, collecting metrics, or setting up OTLP/Prometheus export.