View Source cowboy_otel_h (cowboy_otel v0.2.0)

A cowboy stream handler that extracts spans from http headers and starts and ends opentelemetry span.

Summary

Functions

Intercept the response command, and then set the status code span attribute.
Start the opentelemetry span.
End the opentelemetry span.

Types

-type state() :: #state{}.

Functions

Link to this function

data(StreamID, IsFin, Data, State)

View Source
-spec data(cowboy_stream:streamid(), cowboy_stream:fin(), cowboy_req:resp_body(), State) ->
        {cowboy_stream:commands(), State}
        when State :: state().
Does nothing.
Link to this function

early_error(StreamID, Reason, PartialReq, Resp, Opts)

View Source
Does nothing.
Link to this function

info(StreamID, Info, State)

View Source
-spec info(cowboy_stream:streamid(), any(), State) -> {cowboy_stream:commands(), State}
        when State :: state().
Intercept the response command, and then set the status code span attribute.
Link to this function

init(StreamID, Req0, Opts)

View Source
Start the opentelemetry span.
Link to this function

terminate(StreamID, Reason, State)

View Source
-spec terminate(cowboy_stream:streamid(), cowboy_stream:reason(), state()) -> any().
End the opentelemetry span.