nestjs-wide-events
Installation
SKILL.md
NestJS Wide Events Logging
Emit ONE context-rich structured JSON event per request per service, instead of scattering dozens of log lines across the codebase.
Core Principles
- One event per request per service. Build context throughout the lifecycle; emit once at the end.
- Business context is mandatory. Include subscription tier, account age, feature flags, cart value -- anything needed at 2am during an incident.
- High cardinality is the point. Fields like
user_id,request_id,order_idwith millions of unique values make debugging possible. - High dimensionality wins. 50 fields on one event beats 5 fields across 10 events.
- Structured JSON only. Every field is a queryable key-value pair.
- Tail sampling controls cost. Always keep errors, slow requests, VIP users. Sample the rest.
- No log-level abuse. The wide event IS the log. Level indicates outcome severity only.