diff --git a/.gitignore b/.gitignore index 13fff84d..2013c3c0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /deps /doc /.elixir_ls +/.elixir-tools erl_crash.dump *.ez src/*.erl diff --git a/lib/absinthe/phase/document/execution/resolution.ex b/lib/absinthe/phase/document/execution/resolution.ex index 9356a892..ccf10f72 100644 --- a/lib/absinthe/phase/document/execution/resolution.ex +++ b/lib/absinthe/phase/document/execution/resolution.ex @@ -234,8 +234,8 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do defp reduce_resolution(%{middleware: []} = res), do: res defp reduce_resolution(%{middleware: [middleware | remaining_middleware]} = res) do - start_id = :erlang.unique_integer() - metadata = %{id: start_id, telemetry_span_context: start_id, middleware: middleware, resolution: res} + id = :erlang.unique_integer() + metadata = %{id: id, telemetry_span_context: id, middleware: middleware, resolution: res} :telemetry.execute(@middleware_start, %{system_time: System.system_time()}, metadata) res = @@ -244,10 +244,7 @@ defmodule Absinthe.Phase.Document.Execution.Resolution do res -> reduce_resolution(res) end - stop_id = :erlang.unique_integer() - metadata = %{id: stop_id, telemetry_span_context: stop_id, middleware: middleware, resolution: res} :telemetry.execute(@middleware_stop, %{system_time: System.system_time()}, metadata) - res end diff --git a/lib/absinthe/pipeline.ex b/lib/absinthe/pipeline.ex index d698b0a7..113dd057 100644 --- a/lib/absinthe/pipeline.ex +++ b/lib/absinthe/pipeline.ex @@ -414,12 +414,10 @@ defmodule Absinthe.Pipeline do run_phase(todo, result, [phase | done]) {:ok, result} -> - start_id = :erlang.unique_integer() - metadata = %{id: start_id, telemetry_span_context: start_id, phase: phase, options: options} + id = :erlang.unique_integer() + metadata = %{id: id, telemetry_span_context: id, phase: phase, options: options} :telemetry.execute(@phase_start, %{system_time: System.system_time()}, metadata) result = run_phase(todo, result, [phase | done]) - start_id = :erlang.unique_integer() - metadata = %{id: start_id, telemetry_span_context: start_id, phase: phase, options: options} :telemetry.execute(@phase_stop, %{system_time: System.system_time()}, metadata) result