NestJS · Senior · Question 19 of 75
How do you propagate a trace or correlation ID across Nest microservices?
- 1Use a global variable
- 2IDs are propagated automatically by every transport
- ✓Correct answer: Put it in message headers/metadata, read it in an interceptor on the consumer side and store it in ALS; OpenTelemetry can automate this
Explanation
Consistent propagation lets you follow one user action through HTTP calls, queues and workers.