@dcl/http-tracer-component
v2.0.1
Published
Add tracing spans to each request handler for core components library
Readme
@dcl/http-tracer-component
Adds tracing spans to each request handler, propagating W3C Trace Context
(traceparent / tracestate) headers across HTTP requests.
Installation
npm install @dcl/http-tracer-componentUsage
import { createHttpTracerComponent } from '@dcl/http-tracer-component'
createHttpTracerComponent({ server, tracer })It wraps the server with a middleware that:
- Parses the incoming
traceparentandtracestateheaders - Opens a trace span for the request
- Injects the resulting
traceparent(andtracestate) headers into the response
