Class: Labkit::Tracing::Rails::ActiveRecord::Subscriber Private

Inherits:
Object
  • Object
show all
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

API:

  • private

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.

API:

  • private

"sql.active_record"

Class Method Summary collapse

Class Method Details

.instrumentObject

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

API:

  • private



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