beam-telemetry / cowboy_telemetry

Telemetry instrumentation for Cowboy
Apache License 2.0
30 stars 9 forks source link

Emit stop error event on client and server timeout #4

Closed binaryseed closed 4 years ago

binaryseed commented 4 years ago

When the client making a request hangs up (ex: client timeout), cowboy detects this and executes the terminate stream handler callback with

Reason = {socket_error, closed, 'The socket has been closed.'}

When the server reaches the idle_timeout, cowboy executes the terminate stream handler callback with

Reason = {connection_error, timeout, 'Connection idle longer than configuration allows.'}

This PR emits a [cowboy, request, stop] event with an error instead of a response in that situation, since no response is ever sent to the client.

binaryseed commented 4 years ago