Skip to content

Commit

Permalink
Fix parent span name using selection instead of operation name
Browse files Browse the repository at this point in the history
  • Loading branch information
luizmiranda7 committed Aug 9, 2023
1 parent 4889239 commit f859652
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/instrumentation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ defmodule OpentelemetryAbsinthe.Instrumentation do
blueprint |> Absinthe.Blueprint.current_operation() |> Kernel.||(%{}) |> Map.get(:type)
end

defp get_operation_name(%{blueprint: %Blueprint{} = blueprint}) do
blueprint |> get_graphql_selections() |> List.first()
defp get_operation_name(data) do
data |> get_graphql_selections() |> List.first()
end

defp span_name(_, _, name) when is_binary(name), do: name
Expand Down

0 comments on commit f859652

Please sign in to comment.