otel_shelf 0.1.0
otel_shelf: ^0.1.0 copied to clipboard
OpenTelemetry instrumentation for `package:shelf`. Middleware that opens a SERVER span per request, extracts the inbound W3C traceparent and records `http.*` semconv attributes.
Changelog #
0.1.0 - 2026-08-10 #
Added #
otelShelfMiddleware({tracer, errorStatusBuilder})— a shelfMiddlewarethat opens a SERVER span per incoming request withhttp.request.method,url.full,server.address,server.port,http.response.status_code.- Extracts the W3C
traceparentheader from inbound requests so the device/CLI client's trace stitches into this server span. - 5xx flips span status to Error by default; 4xx does not (per
OTel HTTP semconv — 4xx is client-side error). Override via
errorStatusBuilder. - Zone-scoped suppression
(
runWithoutShelfInstrumentation/ async variant). - 4 tests including end-to-end traceparent stitching.