Skip to content

Commit 2c905e1

Browse files
author
Muriel Picone Farías
committed
Fix reference to subscriber methods in handler
1 parent ce0a663 commit 2c905e1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

instrumentation/grape/lib/opentelemetry/instrumentation/grape/handler.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ module Grape
1010
# This class subscribes to the generated ActiveSupport notifications and generates spans based on them.
1111
class Handler
1212
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+
}
1919

2020
class << self
2121
def subscribe
22-
SUBSCRIPTIONS.each do |event, _subscriber|
22+
SUBSCRIPTIONS.each do |event, subscriber_method|
2323
::ActiveSupport::Notifications.subscribe(event) do |*args|
24-
subscriber(*args)
24+
method(subscriber_method).call(*args)
2525
end
2626
end
2727
end

instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def gem_version
4141
end
4242

4343
def require_dependencies
44-
require_relative 'subscriber'
44+
require_relative 'handler'
4545
end
4646

4747
def subscribe

0 commit comments

Comments
 (0)