Class: Labkit::Tracing::Rails::ActiveRecord::Subscriber Private
- Inherits:
-
Object
- Object
- Labkit::Tracing::Rails::ActiveRecord::Subscriber
- Includes:
- TracingCommon
- Defined in:
- lib/labkit/tracing/rails/active_record/subscriber.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
ActiveRecord bridges active record notifications to the distributed tracing subsystem
Constant Summary collapse
- ACTIVE_RECORD_NOTIFICATION_TOPIC =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"sql.active_record"
Class Method Summary collapse
-
.instrument ⇒ Object
private
Instruments Rails ActiveRecord events for opentracing.
Class Method Details
.instrument ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instruments Rails ActiveRecord events for opentracing. Returns a lambda, which, when called will unsubscribe from the notifications
16 17 18 19 20 |
# File 'lib/labkit/tracing/rails/active_record/subscriber.rb', line 16 def self.instrument subscription = ::ActiveSupport::Notifications.subscribe(ACTIVE_RECORD_NOTIFICATION_TOPIC, SqlInstrumenter.new) create_unsubscriber [subscription] end |