Disabling pointcuts when monitoring background jobs
I am using NewRelic 1.2.005.2 Java Agent to monitor background processes on a jobs server. The jobs are run through Spring's org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean. I have the following lines in my newrelic.yml file to ignore certain pointcuts so that I can get the actual job name class in the stack trace.
enable_custom_tracing: true
class_transformer:
com.newrelic.agent.instrumentation.pointcuts.QuartzJobPointCut:
enabled: false
com.newrelic.agent.instrumentation.pointcuts.SpringPointCutQuartzSystemPointCut:
enabled: false
com.newrelic.agent.instrumentation.pointcuts.frameworks.spring.HandlerMethodInvokerPointCut:
enabled: false
These used to work on NewRelic v 1.0.0.7 i.e. I would get a useful bean name. However, after upgrading to 1.2.005.2, all the results I see are collated under 'org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$StatefulMethodInvokingJob/execute' as opposed to the actual Spring beans that host the job methods. Which pointcuts do I need to exclude to get this to work as before?
Thanks
Thairu
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Ralph Bodenner on 28 Jul, 2010 04:27 PM
Hi Thairu,
I'll pass your query along to Roger, one of our Java agent engineers. There may be another pointcut to disable. It sounds like you've got a @Trace annotation on your job classes, yes?
Ralph
3 Posted by thairu on 28 Jul, 2010 06:40 PM
Hi Ralph. Thanks for the reply. I have the @Trace on the particular functions in the job class, including the main job function.
Support Staff 4 Posted by Roger Hart on 28 Jul, 2010 09:13 PM
Hi Thairu,
I want to make sure I understand what you're aiming for. Your stack traces begin something like this:
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$StatefulMethodInvokingJob/execute
com.example.MyService/doSomething
Are you saying you want the first element to be ccom.example.MyService/doSomething?
Thanks,
Roger
5 Posted by thairu on 28 Jul, 2010 09:25 PM
Yes. That's what I want.
When I ran this on version 1.0.0.7 with the list of pointcuts I listed earlier, I would get a list of slow transactions that would start with com.example.MyService/doSomething as opposed to the Spring bean.
Also, in the Background Tasks, it would break them out by the individual bean, but now they are all lumped under MethodInvokingJobDetailFactoryBean.
Thanks
Thairu
Support Staff 6 Posted by Roger Hart on 29 Jul, 2010 05:51 PM
Hi Thairu,
Sorry for the inconvenience. It appears that "com.newrelic.agent.instrumentation.pointcuts.QuartzJobPointCut" changed to "quartz_job", and "com.newrelic.agent.instrumentation.pointcuts.SpringPointCutQuartzSystemPointCut" no longer exists, and "com.newrelic.agent.instrumentation.pointcuts.frameworks.spring.HandlerMethodInvokerPointCut" changed to "spring_handler_method_invoker"
So if you change your class_transformer config to this:
class_transformer:
It should work. Let me know if you still run into problems.
Thanks,
Roger
Roger Hart resolved this discussion on 29 Jul, 2010 05:51 PM.
thairu re-opened this discussion on 29 Jul, 2010 08:11 PM
7 Posted by thairu on 29 Jul, 2010 08:11 PM
Thanks. I'll try this out. Looks like I should also use the same pattern for any other pointcut I want to disable e.g.
*.pointcuts.FooBarPointCut would be excluded using "foo_bar"?
Thairu
Support Staff 8 Posted by Roger Hart on 29 Jul, 2010 09:36 PM
Unfortunately, no. Some pointcuts use the full class name, some don't. You'll have to look in the log for these messages to see if you picked the right name:
Jul 29, 2010 2:13:25 PM NewRelic INFO: Disabled point cut "quartz_job"
I'll add a story to standardize the naming convention and maybe adding some documentation.
Thanks for pointing this out.
Regards,
Roger
Roger Hart resolved this discussion on 29 Jul, 2010 09:36 PM.
Support Staff 9 Posted by Roger Hart on 30 Jul, 2010 02:57 PM
Done. Thanks for your patience.
Regards,
Roger