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:
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 ininit
2) Delegating all the stream handler callbacks tocowboy_metrics_h
, inserting ametrics_callback
3) Emitting all thestop
events based theMetrics
provided inmetrics_callback
The event
metadata
change, but we gain a ton of useful information about the request:@josevalim @arkgil