forked from socialcast/rpm_contrib
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request newrelic#21 from loe/master
Correct the ActiveMessaging Instrumentation to actually work
- Loading branch information
Showing
1 changed file
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
# == ActiveMessaging Instrumentation == | ||
# Robert R. Meyer | ||
# Blue-Dog-Archolite @ GitHub | ||
# ActiveMessaging Instrumentation | ||
|
||
DependencyDetection.defer do | ||
@name = :active_messaging | ||
|
||
depends_on do | ||
defined?(::ActiveMessaging::Processor) && !NewRelic::Control.instance['disable_active_messaging'] && | ||
!NewRelic::Control.instance['disable_active_mq'] | ||
end | ||
|
||
executes do | ||
NewRelic::Agent.logger.debug 'Installing ActiveMessaging instrumentation' | ||
end | ||
|
||
executes do | ||
::ActiveMessaging::Processor.class_eval do | ||
class << self | ||
add_method_tracer :on_message, 'ActiveMessaging/OnMessage' | ||
end | ||
include NewRelic::Agent::MethodTracer | ||
|
||
add_method_tracer :on_message, 'ActiveMessaging/OnMessage' | ||
end | ||
end | ||
end |