From 33c6e1be09bbe5f28b6beea5dd2e881e8811aef1 Mon Sep 17 00:00:00 2001 From: Andy Jones Date: Wed, 11 Sep 2024 09:40:45 +0100 Subject: [PATCH 1/2] Emit telemetry event on complete --- lib/absinthe/graphql_ws/transport.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/absinthe/graphql_ws/transport.ex b/lib/absinthe/graphql_ws/transport.ex index 84ae76f..f236663 100644 --- a/lib/absinthe/graphql_ws/transport.ex +++ b/lib/absinthe/graphql_ws/transport.ex @@ -119,6 +119,16 @@ defmodule Absinthe.GraphqlWS.Transport do end def handle_info({:complete, id}, socket) do + + metadata = %{ + platform: get_platform(socket), + session_id: get_session_id(socket), + client_app_version: get_client_app_version(socket), + user_id: get_user_id(socket), + } + + :telemetry.execute([:absinthe_graphql_ws, :handle_info, :complete], %{}, metadata) + {:push, {:text, Message.Complete.new(id)}, socket} end From e67cd7fd5aff8d9f99eb6b88543972a570ccc96d Mon Sep 17 00:00:00 2001 From: Andy Jones Date: Wed, 11 Sep 2024 09:41:32 +0100 Subject: [PATCH 2/2] Remove whitespace --- lib/absinthe/graphql_ws/transport.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/absinthe/graphql_ws/transport.ex b/lib/absinthe/graphql_ws/transport.ex index f236663..02e8f79 100644 --- a/lib/absinthe/graphql_ws/transport.ex +++ b/lib/absinthe/graphql_ws/transport.ex @@ -119,7 +119,6 @@ defmodule Absinthe.GraphqlWS.Transport do end def handle_info({:complete, id}, socket) do - metadata = %{ platform: get_platform(socket), session_id: get_session_id(socket),