lib/opentelemetry/instrumentation/action_view/railtie.rb in opentelemetry-instrumentation-action_view-0.1.3 vs lib/opentelemetry/instrumentation/action_view/railtie.rb in opentelemetry-instrumentation-action_view-0.2.0
- old
+ new
@@ -14,16 +14,14 @@
].freeze
# This Railtie sets up subscriptions to relevant ActionView notifications
class Railtie < ::Rails::Railtie
config.after_initialize do
- SUBSCRIPTIONS.each do |subscription_name|
- subscriber = OpenTelemetry::Instrumentation::ActionView::SpanSubscriber.new(
- name: subscription_name,
- tracer: ActionView::Instrumentation.instance.tracer
- )
+ ::OpenTelemetry::Instrumentation::ActiveSupport::Instrumentation.instance.install({})
- ::OpenTelemetry::Instrumentation::ActionView.subscribe(subscription_name, subscriber)
+ SUBSCRIPTIONS.each do |subscription_name|
+ config = ActionView::Instrumentation.instance.config
+ ::OpenTelemetry::Instrumentation::ActiveSupport.subscribe(ActionView::Instrumentation.instance.tracer, subscription_name, config[:notification_payload_transform], config[:disallowed_notification_payload_keys])
end
end
end
end
end