livery_instrument_metrics (livery v0.2.0)
View SourceHTTP server metrics middleware powered by the instrument
library.
Records the OpenTelemetry HTTP server semantic-convention metrics on every request:
http.server.active_requests(up_down_counter): incremented on request entry, decremented on exit.http.server.request.duration(histogram, seconds): wall-clock time from middleware entry to response return.
Attributes follow the conventions:
http.request.methodhttp.response.status_codenetwork.protocol.nameurl.scheme
State: #{meter => binary() | atom()} (defaults to <<"livery">>).
Instruments are resolved from the instrument registry on each request
(create_* is idempotent and returns the existing handle by name), so
the registry is the single source of truth and a registry restart
self-heals. If the registry is unavailable, the request is served
without metrics rather than failing.
Summary
Functions
-spec call(livery_req:req(), livery_middleware:next(), map()) -> livery_resp:resp().