module GraphQL::Tracing::NotificationsTrace
This implementation forwards events to a notification handler (i.e. ActiveSupport::Notifications or Dry::Monitor::Notifications) with a graphql suffix.
See ActiveSupportNotificationsTrace ActiveSupport::Notifications integration
Constants
- CURRENT_EV_KEY
- PREVIOUS_EV_KEY
Public Class Methods
# File lib/graphql/tracing/notifications_trace.rb, line 80 def initialize(engine:, **rest) adapter = if defined?(Dry::Monitor) && engine == Dry::Monitor DryMonitoringAdapter elsif defined?(ActiveSupport::Notifications) && engine == ActiveSupport::Notifications ActiveSupportNotificationsAdapter else engine end @notifications = adapter.new super end
Parameters
-
engine(Class) — The notifications engine to use, egDry::MonitororActiveSupport::Notifications
Calls superclass method
Public Instance Methods
# File lib/graphql/tracing/notifications_trace.rb, line 110 def begin_analyze_multiplex(multiplex, analyzers) begin_notifications_event("analyze.graphql", {multiplex: multiplex, analyzers: analyzers}) super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 169 def begin_dataloader_source(source) begin_notifications_event("dataloader_source.graphql", { source: source }) super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 126 def begin_execute_field(field, object, arguments, query) begin_notifications_event("execute_field.graphql", {field: field, object: object, arguments: arguments, query: query}) super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 159 def begin_resolve_type(type, object, context) begin_notifications_event("resolve_type.graphql", {type: type, object: object, context: context}) super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 141 def dataloader_fiber_resume(source) prev_ev = Fiber[PREVIOUS_EV_KEY] if prev_ev begin_notifications_event(prev_ev.name, prev_ev.payload) end super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 136 def dataloader_fiber_yield(source) Fiber[PREVIOUS_EV_KEY] = finish_notifications_event super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 115 def end_analyze_multiplex(_multiplex, _analyzers) finish_notifications_event super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 174 def end_dataloader_source(source) finish_notifications_event super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 131 def end_execute_field(_field, _object, _arguments, _query, _result) finish_notifications_event super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 164 def end_resolve_type(type, object, context, resolved_type) finish_notifications_event super end
Calls superclass method
# File lib/graphql/tracing/notifications_trace.rb, line 120 def execute_multiplex(**payload) @notifications.instrument("execute.graphql", payload) do super end end
Calls superclass method
Source
# File lib/graphql/tracing/notifications_trace.rb, line 98 def lex(**payload) @notifications.instrument("lex.graphql", payload) do super end end
Calls superclass method
Source
# File lib/graphql/tracing/notifications_trace.rb, line 92 def parse(**payload) @notifications.instrument("parse.graphql", payload) do super end end
Calls superclass method
Source
# File lib/graphql/tracing/notifications_trace.rb, line 104 def validate(**payload) @notifications.instrument("validate.graphql", payload) do super end end
Calls superclass method