View Source OpentelemetryAbsinthe.Instrumentation (opentelemetry_absinthe v2.3.2)

Module for automatic instrumentation of Absinthe resolution.

It works by listening to [:absinthe, :execute, :operation, :start/:stop] telemetry events, which are emitted by Absinthe only since v1.5; therefore it won't work on previous versions.

(you can still call OpentelemetryAbsinthe.Instrumentation.setup() in your application startup code, it just won't do anything.)

Summary

Types

graphql_handled_event_error()

@type graphql_handled_event_error() :: %{
  locations: [%{column: integer(), line: integer()}],
  message: String.t(),
  path: [String.t()]
}

graphql_handled_event_measurements()

@type graphql_handled_event_measurements() :: %{duration: :int}

graphql_handled_event_metadata()

@type graphql_handled_event_metadata() :: %{
  :operation_name => String.t() | nil,
  :operation_type => :query | :mutation,
  :schema => Absinthe.Schema.t(),
  :errors => [graphql_handled_event_error()] | nil,
  :status => :ok | :error,
  optional(atom()) => any()
}

Functions

default_config()

handle_start(event_name, measurements, metadata, config)

handle_stop(event_name, measurements, data, config)

setup(instrumentation_opts \\ [])

span_ctx(args \\ [])

(macro)

span_ctx(record, args)

(macro)

teardown()