# APM + Grails

**URL:** <https://discuss.elastic.co/t/apm-grails/215346>\
**Category:** APM\
**Tags:** java\
**Created:** [January 16, 2020, 3:37pm UTC](https://discuss.elastic.co/t/apm-grails/215346 "2020-01-16T15:37:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokelly2020](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@gokelly2020](https://discuss.elastic.co/u/gokelly2020)\
**Post date:** [January 16, 2020, 3:37pm UTC](https://discuss.elastic.co/t/apm-grails/215346/1 "2020-01-16T15:37:40Z")

</div>

Hi,  
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

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [January 17, 2020, 12:56pm UTC](https://discuss.elastic.co/t/apm-grails/215346/2 "2020-01-17T12:56:52Z")

</div>

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](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-set-name).

---

<div class="post-metadata">

**Author:** ![gokelly2020](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@gokelly2020](https://discuss.elastic.co/u/gokelly2020)\
**Post date:** [January 17, 2020, 1:22pm UTC](https://discuss.elastic.co/t/apm-grails/215346/3 "2020-01-17T13:22:44Z")

</div>

Hi,  
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](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-disable-instrumentations) but Im not clear on the specifics.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [January 20, 2020, 5:04pm UTC](https://discuss.elastic.co/t/apm-grails/215346/4 "2020-01-20T17:04:38Z")

</div>

Hi Gavin,

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.

> **[SylvainJuge/apm-contrib](https://github.com/SylvainJuge/apm-contrib/tree/add-grails3-example/apm-agent-java/frameworks/grails3)**
>
> Contrib repository for Elastic APM. Contribute to SylvainJuge/apm-contrib development by creating an account on GitHub.

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 10, 2020, 1:04pm UTC](https://discuss.elastic.co/t/apm-grails/215346/5 "2020-02-10T13:04:38Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
