Sha256: edf6d5ed7c4b39b1c73a552084be95a7215809f3e37b46aea91dec23de6bc0b4

Contents?: true

Size: 1.23 KB

Versions: 34

Compression:

Stored size: 1.23 KB

Contents

DependencyDetection.defer do
  @name = :passenger
  
  depends_on do
    defined?(PhusionPassenger)
  end

  executes do
    NewRelic::Agent.logger.debug "Installing Passenger event hooks."

    PhusionPassenger.on_event(:stopping_worker_process) do
      NewRelic::Agent.logger.debug "Passenger stopping this process, shutdown the agent."
      NewRelic::Agent.instance.shutdown
    end

    PhusionPassenger.on_event(:starting_worker_process) do |forked|
      # We want to reset the stats from the stats engine in case any carried
      # over into the spawned process.  Don't clear them in case any were
      # cached.  We do this even in conservative spawning.
      NewRelic::Agent.after_fork(:force_reconnect => true)
    end
  end
end

DependencyDetection.defer do
  depends_on do
    defined?(::Passenger) && defined?(::Passenger::AbstractServer) || defined?(::IN_PHUSION_PASSENGER)
  end

  executes do
    ## We're on an older version of passenger
    ## FIXME: This warning is printing on current version of passenger
    # NewRelic::Agent.logger.warn "An older version of Phusion Passenger has been detected.  We recommend using at least release 2.1.1."

    NewRelic::Agent::Instrumentation::MetricFrame.check_server_connection = true
  end
end

Version data entries

34 entries across 34 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.0 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.2.1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.2 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.2.beta1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.1.beta1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
ghazel-newrelic_rpm-3.4.0.2 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.0.1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.0 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.0.beta2 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.3.5 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.3.5.beta1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
newrelic_rpm-3.4.0.beta1 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.8 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.7 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.6 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.5 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.4 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.3 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
dolores_rpm-3.3.4.1.fork2 lib/new_relic/agent/instrumentation/passenger_instrumentation.rb