A client of mine is trying to set up a measure for “Method – Return Value”
that splits on the class name of a method return value. To that end, we created a method sensor and selected “Method return values will be
recorded.” The object we’re returning is a simple POJO, and in the
PurePath we can see the return object’s toString() data being recorded. When we set the “Accessor” field to a method like “getName()”, then it returns just
fine. If we instead set the “Accessor” field to the specific values
“getClass()” or “getClass().getName()” then the PurePaths show “accessor
Why can’t we use the getClass() method as part of a sensor
accessor? Or is there another way to create a splitting based on the
classname of a method return value?
you can find out more about this by enabling the agent debug flag "debugIntrospectionJava".
to do so go into client debug mode (Ctrl+Shift+F9), go to the corerct system profile -> agent group -> agent mapping -> debug... and add this debug flag with value "true".
after that you should get way bigger log files for those agents.
just search for "while evaluating accessor" in there and see what comes up.
Please check the below SO posts which might be related to your case: