Creates a @cleverbrush/server middleware that opens an OpenTelemetry
SERVER span for every incoming request.
Should be registered as the first middleware so that the span
wraps CORS, auth, request logging, and the handler — capturing the
full request lifetime.
Behavior:
Extracts inbound trace context from request headers
(W3C traceparent, baggage).
Names the span ${operationId} if available, otherwise
${method} ${http.route}, otherwise ${method} ${url.path}.
Creates a
@cleverbrush/servermiddleware that opens an OpenTelemetrySERVERspan for every incoming request.Should be registered as the first middleware so that the span wraps CORS, auth, request logging, and the handler — capturing the full request lifetime.
Behavior:
traceparent,baggage).${operationId}if available, otherwise${method} ${http.route}, otherwise${method} ${url.path}.http.request.method,url.path,url.scheme,server.address,user_agent.original,http.route).http.response.status_codeafternext()completes.ERRORand records the exception on uncaught errors.ctx.items.get(OTEL_SPAN_ITEM_KEY)for downstream code to enrich.