Tapper Absinthe Plug v0.1.0 Tapper.Plug.Absinthe
Works in concert with Tapper.Plug.Trace
to propagate the Tapper Id into the Absinthe context.
You can then access the Tapper id via a resolver’s info
(%Absinthe.Resolution{}
)
parameter, using this modules’ get/1
function.
In your router:
plug Tapper.Plug.Trace # pick up the trace
plug Tapper.Plug.Absinthe # copy the id into the Absinthe context
In your resolver:
def resolve(args, info) do
# pick up from id info.context
tapper_id = Tapper.Plug.Absinthe.get(info)
tapper_id = Tapper.start_span(id, name: "my-resolver") # etc.
...
Tapper.finish_span(tapper_id)
end
Summary
Functions
Callback implementation for Plug.call/2
Get the tapper id from the Absinthe Resolution info if present, or return :ignore
Callback implementation for Plug.init/1
Functions
Callback implementation for Plug.call/2
.
get(info)
get(resolution :: %Absinthe.Resolution{acc: term, adapter: term, arguments: term, context: term, definition: term, errors: term, extensions: term, middleware: term, parent_type: term, path: term, private: term, root_value: term, schema: term, source: term, state: term, value: term} | map) :: Tapper.Id.t
Get the tapper id from the Absinthe Resolution info if present, or return :ignore
.
Callback implementation for Plug.init/1
.