Im using the apm (7.5.1 server) with a grails app (grails mvc 2.5.5) it seems the APM is always reading the SimpleGrailsController as the entrypoint, regardless of the request or backend code thats hit. Is there a way to get APM to ignore this class ? Ive tried combinations of trace_methods and disable_instrumentations but no luck so far.
apm agent 1.11.0
We currently don't have specific support for Grails so that's why you just see
SimpleGrailsController which I think is probably the Spring MVC controller. How would you ideally like the transaction to be named?
In the mean time, you could manually set the name of your transactions with this API method: https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-set-name.
Thanks for the response. The issue isnt one of naming but of correct tracing. For example, in our API service apm reports the start of traces using the controller.method_name ( myController.doSomething) which is great but in the grails app SimpleGrailsController is always read as the starting point.
For example, Request A starts with SimpleGrailsController then goes on to trace our backend classes. Request B then comes in (different to A) but also starts with SimpleGrailsController then continues to trace our backend classes (which are different from Request A).
Ideally we could configure APM to ignore SimpleGrailsController so that we get separate traces for each different request (similar to myController.doSomethingA and myController.doSomethingB). Ive tried disable_instrumentation spring-mvc but its not doing the trick.
By the way, is there any documentation describing exactly what the individual options for disable_instrumentation do? Ive seen https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-disable-instrumentations but Im not clear on the specifics.
In the case of Grails applications, the most simple way is to use a framework-specific filter (aka Interceptors
in grails universe) that will handle the proper naming (and thus grouping) of your application transactions.
I have created a sample application that shows how to do it with Grails3, here is the link to the pull-request.
I am definitely not a grails expert, thus do not hesitate to send any feedback if it does not work as you'd expect, I would be happy to help.
While there is no exhaustive description of all
disable_instrumentation values, most of them are self-explanatory and each of them is linked to one plugin, thus grepping agent source code might get you more details if needed.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.