elixir-plug / plug_cowboy

Plug adapter for the Cowboy web server
Other
243 stars 48 forks source link

Add telemetry #31

Closed josevalim closed 4 years ago

josevalim commented 4 years ago

Since we are nearing Phoenix v1.5 release, I think we should get this in before so we can apply similar changes to Phoenix.

It is very similar to @bryannaegele's PR with some changes:

  1. The conn is given to all events - although exception emits a stale connection

  2. I have renamed the event to [:plug_adapter, :call, :start]. This is based on our previous discussions. Since I want this event to be generic in regards to the adapter, then I think it is best to name it based on Plug's contract. In other words, this event is triggered when the adapter calls the underlying Plug. For this reason, I am also passing the called plug as metadata.

Please review it ASAP so I can apply these changes to Phoenix.

/cc @GregMefford @binaryseed @bryannaegele

josevalim commented 4 years ago

@GregMefford it handles both. catch is not specific to Elixir.

binaryseed commented 4 years ago

Third time's a charm! looks great

Previous PRs:

josevalim commented 4 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: