Class: OpenTelemetry::Instrumentation::Grape::Subscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/instrumentation/grape/subscriber.rb

Overview

Manages all subscriptions, both for custom subscribers and built-in notifications

Class Method Summary collapse

Class Method Details

.subscribeObject

Subscribe to all notifications (except those specified in the :ignored_events configs)



16
17
18
19
20
21
22
23
# File 'lib/opentelemetry/instrumentation/grape/subscriber.rb', line 16

def subscribe
  subscriptions = filter_ignored_events(SUBSCRIPTIONS)
  subscriptions.each do |subscriber_method, event|
    ::ActiveSupport::Notifications.subscribe(event) do |*args|
      EventHandler.send(subscriber_method, *args)
    end
  end
end