Sha256: 7694d4f1070111ddacf83e56a43d478ec311cd3bbeff8a7738f0a7f32daa5daf

Contents?: true

Size: 1022 Bytes

Versions: 30

Compression:

Stored size: 1022 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require 'new_relic/agent/instrumentation/custom_events_subscriber'
require 'new_relic/agent/prepend_supportability'

DependencyDetection.defer do
  @name = :custom_event_notifications

  depends_on do
    defined?(ActiveSupport::Notifications) &&
      defined?(ActiveSupport::IsolatedExecutionState)
  end

  depends_on do
    !NewRelic::Agent.config[:active_support_custom_events_names].empty? &&
      !NewRelic::Agent::Instrumentation::CustomEventsSubscriber.subscribed?
  end

  executes do
    NewRelic::Agent.logger.info('Installing notifications based ActiveSupport custom events instrumentation')
  end

  executes do
    NewRelic::Agent.config[:active_support_custom_events_names].each do |name|
      ActiveSupport::Notifications.subscribe(name, NewRelic::Agent::Instrumentation::CustomEventsSubscriber.new)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.16.1 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.5.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/rails_notifications/custom_events.rb