lib/opentelemetry/instrumentation/action_view/railtie.rb in opentelemetry-instrumentation-action_view-0.7.2 vs lib/opentelemetry/instrumentation/action_view/railtie.rb in opentelemetry-instrumentation-action_view-0.7.3
- old
+ new
@@ -17,16 +17,19 @@
# This Railtie sets up subscriptions to relevant ActionView notifications
class Railtie < ::Rails::Railtie
config.after_initialize do
::OpenTelemetry::Instrumentation::ActiveSupport::Instrumentation.instance.install({})
+ instance = ::OpenTelemetry::Instrumentation::ActionView::Instrumentation.instance
+ span_name_formatter = instance.config[:legacy_span_names] ? ::OpenTelemetry::Instrumentation::ActiveSupport::LEGACY_NAME_FORMATTER : nil
+
SUBSCRIPTIONS.each do |subscription_name|
- config = ActionView::Instrumentation.instance.config
::OpenTelemetry::Instrumentation::ActiveSupport.subscribe(
- ActionView::Instrumentation.instance.tracer,
+ instance.tracer,
subscription_name,
- config[:notification_payload_transform],
- config[:disallowed_notification_payload_keys]
+ instance.config[:notification_payload_transform],
+ instance.config[:disallowed_notification_payload_keys],
+ span_name_formatter: span_name_formatter
)
end
end
end
end