Ignore Spring Boot MVC endpoint and switch to @CaptureTransaction

Kibana version:

Elasticsearch version:

APM Server version:

APM Agent language and version:

Original install method (e.g. download page, yum, deb, from source, etc.) and version:

Fresh install or upgraded from other version?
fresh install

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

My APM instance is correctly working with Spring Boot server in production. Every controller method call is traced. But I need a different behaviour for some HTTP invocations.

For some of my spring mvc controllers, even if the HTTP call is the same, I need 2 distict transactions. I added the @CaptureTransaction annotations inside the business code but I don't understand how to disable the tracing for the controllers.

Steps to reproduce:
I tried to:

  1. add classes_excluded_from_instrumentation=my.contoller.package.* but doesn't work becaus the transaction (I guess) is started earlier by the agent
  2. transaction_ignore_urls=/controller/path but again, i still see the traced controller methods
  3. add disable_instrumentations=spring-mvc (disables all tracing, but doesn't open new transactions when invoking annotated methods.

I managed to solve, the working solution is using transaction_ignore_urls and add the @traced annotation in the java code.

I mispelled the configuration name.

1 Like

Hi @ecostanzi ! That's good to hear that you found a suitable solution.

Alternatively, you could have used the public API to change transaction name at runtime, which could be a bit more flexible and reliable than relying only on configuration.

As your application evolves, you'll likely have to keep this configuration up to date, and there might be things that will be ignored until you notice that they are missing. With explicit calls to the API, in the worst case some transactions won't be named as you expect, but won't be ignored.

Thank you @Sylvain_Juge, your alternative is much better and flexbile.

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