I'm currently working on some library code where I'd like to be able to send arbitrary telemetry events (possibly including exceptions, but what I mostly want is the :duration) from a pipeline which uses Plug.Telemetry.
This unfinished PR is me asking whether you have any interest in changing this plug's behaviour to allow the user to take advantage of the duration measurement for custom events, by storing the start time and event prefix in the conn's private instead of in a function capture. No hard feelings if not. If yes, I'll add tests and docs.
side-note: Dropped the precalculated start_event and stop_event lists, possibly hurting performance by doing so.
Because the code is relatively small, I'd prefer for you to have your own implementation, than exposing more of the plug implementation details. Sorry and thanks :)
Hi :wave:
I'm currently working on some library code where I'd like to be able to send arbitrary telemetry events (possibly including exceptions, but what I mostly want is the
:duration
) from a pipeline which usesPlug.Telemetry
.This unfinished PR is me asking whether you have any interest in changing this plug's behaviour to allow the user to take advantage of the duration measurement for custom events, by storing the start time and event prefix in the conn's
private
instead of in a function capture. No hard feelings if not. If yes, I'll add tests and docs.side-note: Dropped the precalculated
start_event
andstop_event
lists, possibly hurting performance by doing so.