Sha256: e7163011a66fd2a6bcba4999d30bcd5e2ebaddb94a0fc4a2a8006b8e7d2f8549

Contents?: true

Size: 1.06 KB

Versions: 16

Compression:

Stored size: 1.06 KB

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_relative '<%= @name.downcase %>/instrumentation'
require_relative '<%= @name.downcase %>/chain'
require_relative '<%= @name.downcase %>/prepend'

DependencyDetection.defer do
  named :<%= @name.match?(/\-|\_/) ? "'#{@name.downcase}'" : @name.downcase %>

  depends_on do
    # The class that needs to be defined to prepend/chain onto. This can be used
    # to determine whether the library is installed.
    defined?(::<%= @class_name %>)
    # Add any additional requirements to verify whether this instrumentation
    # should be installed
  end

  executes do
    ::NewRelic::Agent.logger.info('Installing <%= @name.downcase %> instrumentation')

    if use_prepend?
      prepend_instrument ::<%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>::Chain
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
newrelic_rpm-9.10.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.10.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.9.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.8.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.7.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.7.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.6.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.5.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.4.2 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.4.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.4.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.3.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.3.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.2.2 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.2.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.2.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt