File tree 2 files changed +5
-5
lines changed
instrumentation/grape/lib/opentelemetry/instrumentation/grape
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ def gem_version
35
35
36
36
def require_dependencies
37
37
require_relative 'subscriber'
38
- require_relative 'event_handler'
39
- require_relative 'custom_subscribers/endpoint_run'
40
38
end
41
39
42
40
def subscribe
Original file line number Diff line number Diff line change 4
4
#
5
5
# SPDX-License-Identifier: Apache-2.0
6
6
7
+ require_relative 'custom_subscribers/endpoint_run'
8
+ require_relative 'event_handler'
9
+
7
10
module OpenTelemetry
8
11
module Instrumentation
9
12
module Grape
@@ -31,13 +34,12 @@ def subscribe
31
34
#
32
35
# Reference: https://github.com/rails/rails/blob/05cb63abdaf6101e6c8fb43119e2c0d08e543c28/activesupport/lib/active_support/notifications/fanout.rb#L320-L322
33
36
CUSTOM_SUBSCRIPTIONS = {
34
- endpoint_run : ' OpenTelemetry::Instrumentation::Grape::CustomSubscribers::EndpointRun'
37
+ endpoint_run : OpenTelemetry ::Instrumentation ::Grape ::CustomSubscribers ::EndpointRun
35
38
} . freeze
36
39
37
40
def subscribe_to_custom_notifications
38
41
CUSTOM_SUBSCRIPTIONS . each do |event , klass |
39
- custom_subscriber = Object . const_get ( klass ) . new
40
- ::ActiveSupport ::Notifications . subscribe ( "#{ event } .grape" , custom_subscriber )
42
+ ::ActiveSupport ::Notifications . subscribe ( "#{ event } .grape" , klass . new )
41
43
end
42
44
end
43
45
You can’t perform that action at this time.
0 commit comments