cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

How can I debug method sensor rules?

robert_j_greig
Newcomer

The application I am monitoring uses AspectJ to deal with a few things including logging. This makes the Purepath tree highly unwieldy with lots of additional nodes that add little value.

I have tried to exclude the methods but I cannot get it to work no matter what I do - the methods still appear in the tree. I have tried both hot deployment and restarting the JVMs.

My question more generally is how to debug why a rule is or is not firing?

My configuration is using a global exclude. Everything else seems relatively self-explanatory so I am not sure where I could be going wrong. Any suggestion how to go about analysing?

Thanks,

Robert

11 REPLIES 11

Babar_Qayyum
DynaMight Leader
DynaMight Leader

Hello Robert,

You can exclude or include the method of any sensors in the Client Debug Mode (Ctrl + Alt + F9) from the Settings > dynatrace Server > Sensor Packs.

Regards,

Babar

robert_j_greig
Newcomer

Hi Babar,

My question is more about working out *why* my sensor rule is not working as I expect. I still see lots of calls in the Purepath tree that I expected to be eliminated by my exclusion rule. What is the best way of going about working out what is not right? Since this is AspectJ there are lots of extra levels being added to the tree by these calls making it much harder to read than it ought to be.

Is there something special about how auto sensors use the exclusion rules?

Thanks,

Robert

Hello Robert,

On the first stage I totally misunderstood your requirements, therefore, I replied you with that state of mind but @Cody K. explained very well.

Regards,

Babar

Cody_Kachelski
Dynatrace Helper
Dynatrace Helper

Hi Robert,

If you look at the purepath details, for those methods, if you right click and choose details, does it say they are coming from autosensors? If so, the exclusion will not take effect as autosensors pick up data automatically without bytecode injection to add context to purepaths.

Please let me know if you have further questions.

Thanks!

-Cody

Yes these are from auto sensors.

My issue is that the purepath tree is made extremely difficult to read by the inclusion of these methods (which are driven by aspectj). Given they are used for logging aspects, they appear all over the place.

Is there any way to exclude particular methods from the purepath tree, in order to aid with readability? Surely I am not the first person to want this?

Thanks,

Robert

Hello Robert,

There is a way to exclude which I mentioned before but there is one more way specifically for the Auto Sensor to control the instrumentation, so change the Auto Sensor settings from default to lower and check what is the impact.

Might be it will work for you.

Regards,

Babar

dave_mauney
Dynatrace Champion
Dynatrace Champion

Hi Robert,

Not sure if I understand fully but let me say that Autosensor methods do not honor Global Exclusions. Only Instrumentation Sensors are affected by exclusions. So, if you are seeing too many methods due to auto sensors, my suggestion would be to turn all of them off using the third icon from the left at the top of the PurePath dashlet. Also, make sure you do not have "Show all nodes" mode in effect (top right of PurePath tree pane). If the methods you are interested in excluding have Grey "M" icons and are light/italicized, it means they are auto sensor methods.

HTH,

dave

Thanks Dave - hiding the autosensor methods does help a lot (I had never spotted that icon before).

More generally it would be nice if the purepath tree did honour the exclusions - in general seeing some of them is helpful but the way aspectj works it makes the tree extremely cluttered if you show all of them. Has nobody else who uses aspectj or other AOP frameworks ever brought this up before?

Thanks,

Robert

Hi Robert,

There would have to be some flag added to decide if methods should be ignored or not ignored for autosensors, as I think it would be more common to want to see the excluded methods, especially if there are bottlenecks in them.

I don't recall anyone else asking for excludes to affect autosensors.

Thanks,

dave

Cody_Kachelski
Dynatrace Helper
Dynatrace Helper

Robert,

Do these show as methods or "logging" in the purepaths? I'm wondering if editing the configuration of the "logging" sensor pack for the relevant agent group could have an impact here. As Dave says, your global exclusion will not affect autosensor methods, though you could hide them.

Thanks,

Cody

Hi Cody,

These appear as methods, not logging.

If you want to reproduce this it is pretty simple. Just use jcabi logging aspect, which is a set of annotations that leverage AspectJ under the covers. You can fairly trivially add this to any app (e.g. EasyTravel) by updating the maven pom then adding some logging annotations to certain classes. Then just stand back and look at your purepath tree!

Thanks,

Robert