beam-telemetry / cowboy_telemetry

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

Wrap cowboy_metrics_h! #6

Closed binaryseed closed 4 years ago

binaryseed commented 4 years ago

After thinking through the comments from @essen in #5, I thought I'd try actually re-using cowboy_metrics_h... This was an experiment but the result is pretty interesting.

This PR re-works the entire handler by:

1) Emitting a start span event immediately in init 2) Delegating all the stream handler callbacks to cowboy_metrics_h, inserting a metrics_callback 3) Emitting all the stop events based the Metrics provided in metrics_callback

The event metadata change, but we gain a ton of useful information about the request:

@josevalim @arkgil

binaryseed commented 4 years ago

TODO: