File tree 2 files changed +9
-9
lines changed
instrumentation/grape/lib/opentelemetry/instrumentation/grape
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,18 @@ module Grape
10
10
# This class subscribes to the generated ActiveSupport notifications and generates spans based on them.
11
11
class Handler
12
12
SUBSCRIPTIONS = {
13
- 'endpoint_run.grape' => endpoint_run ,
14
- 'endpoint_render.grape' => endpoint_render ,
15
- 'endpoint_run_filters.grape' => endpoint_run_filters ,
16
- 'endpoint_run_validators.grape' => endpoint_run_validators ,
17
- 'format_response.grape' => format_response
18
- } . freeze
13
+ 'endpoint_run.grape' => : endpoint_run,
14
+ 'endpoint_render.grape' => : endpoint_render,
15
+ 'endpoint_run_filters.grape' => : endpoint_run_filters,
16
+ 'endpoint_run_validators.grape' => : endpoint_run_validators,
17
+ 'format_response.grape' => : format_response
18
+ }
19
19
20
20
class << self
21
21
def subscribe
22
- SUBSCRIPTIONS . each do |event , _subscriber |
22
+ SUBSCRIPTIONS . each do |event , subscriber_method |
23
23
::ActiveSupport ::Notifications . subscribe ( event ) do |*args |
24
- subscriber ( *args )
24
+ method ( subscriber_method ) . call ( *args )
25
25
end
26
26
end
27
27
end
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def gem_version
41
41
end
42
42
43
43
def require_dependencies
44
- require_relative 'subscriber '
44
+ require_relative 'handler '
45
45
end
46
46
47
47
def subscribe
You can’t perform that action at this time.
0 commit comments