We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up the cowboy stream handler like this:
#{metrics_callback => fun prometheus_cowboy2_instrumenter:observe/1, stream_handlers => [cowboy_telemetry_h, cowboy_metrics_h, cowboy_stream_h]
leads to a crash:
2024-03-25T12:25:21.637585+01:00 <0.3469.0> telemetry:execute/3 : error: Handler opentelemetry_cowboy_handlers has failed and has been detached. Class=error Reason={case_clause,[]} Stacktrace=[{otel_telemetry,pop_from_tracer_stack,1, [{file, "/usr/src/erlang/erccn/_build/default/lib/opentelemetry_telemetry/src/otel_telemetry.erl"}, {line,110}]}, {otel_telemetry,end_telemetry_span,2, [{file, "/usr/src/erlang/erccn/_build/default/lib/opentelemetry_telemetry/src/otel_telemetry.erl"}, {line,49}]}, {opentelemetry_cowboy,handle_event,4, [{file, "/usr/src/erlang/erccn/_build/default/lib/opentelemetry_cowboy/src/opentelemetry_cowboy.erl"}, {line,79}]}, {telemetry,'-execute/3-fun-0-',4, [{file, "/usr/src/erlang/erccn/_build/default/lib/telemetry/src/telemetry.erl"}, {line,160}]}, {lists,foreach_1,2,[{file,"lists.erl"},{line,1686}]}, {cowboy_metrics_h,terminate,3, [{file, "/usr/src/erlang/erccn/_build/default/lib/cowboy/src/cowboy_metrics_h.erl"}, {line,302}]}, {cowboy_stream,terminate,3, [{file, "/usr/src/erlang/erccn/_build/default/lib/cowboy/src/cowboy_stream.erl"}, {line,138}]}, {cowboy_http2,terminate_stream_handler,4, [{file, "/usr/src/erlang/erccn/_build/default/lib/cowboy/src/cowboy_http2.erl"}, {line,1334}]}]
the problem is that cowboy_telemetry_h abuses cowboy_metrics_h and overwrites the metrics_callback setting.
cowboy_telemetry_h
cowboy_metrics_h
metrics_callback
A workarround is to change the order of the handlers:
#{metrics_callback => fun prometheus_cowboy2_instrumenter:observe/1, stream_handlers => [cowboy_metrics_h, cowboy_telemetry_h, cowboy_stream_h]
The text was updated successfully, but these errors were encountered:
A pull request is welcome!
Sorry, something went wrong.
No branches or pull requests
Setting up the cowboy stream handler like this:
leads to a crash:
the problem is that
cowboy_telemetry_h
abusescowboy_metrics_h
and overwrites themetrics_callback
setting.A workarround is to change the order of the handlers:
The text was updated successfully, but these errors were encountered: