Sha256: 9b6ed1a1d335bcff62397924a0b1fe4033f78b551edfc7c26673c08341e5c180

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 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 %>
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newrelic_rpm-9.1.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-9.0.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.16.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.15.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.14.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.13.1 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.13.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.12.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt
newrelic_rpm-8.11.0 lib/tasks/instrumentation_generator/templates/dependency_detection.tt