Getting Response Times for GraphQL Queries over Phoenix/Absinthe Socket?

My front end currently uses websockets to issue GraphQL API queries to our server, and I was wondering what would be the best way to calculate the total request time for metric tracking.

For context, we are using Absinthe and Phoenix, and I know Absinthe outputs the response time in the debug logs. I wrote a Plugin for Absinthe that captures the diff between before and after resolution, but I believe this only captures the time it takes to process the Absinthe doc + data.

I know with Phoenix, you can use a Plug to inject a time and use register_before_send to grab the response time.
Is there any way to do the exact same thing, but when a user is connected via a websocket?


Hi @dtrippe. The latest RC release of Absinthe 1.5 includes an integration with Telemetry that allows you to hook into events like a document being executed regardless of whether it is executed via HTTP or over a websocket.

Wow, that’s awesome-- definitely looking forward to that.

Thanks for the quick reply @benwilson512.