Invalid transaction names in APM UI with Java Agent

Kibana version:

6.6.1

Elasticsearch version:

6.6.1

APM Server version:

6.6.1

APM Agent language and version:

Java, 1.4.0

Browser version:

firefox, chrome

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

helm chart

Fresh install or upgraded from other version?

fresh

**Description of the problem **:

I have Elastic, APM and Agent running all fine. Java Servlet and JDBC calls get traced and in the transaction details I can see all the details like method, url, sql query, etc.

However the transaction timeline does not look like:

https://www.elastic.co/guide/en/kibana/6.7/spans.html

In the timeline on the example screenshot I can see the basics of the issued query or the path of the queried HTTP endpoint. In my running application I only see "GET" for HTTP calls and "SELECT" for JDBC calls.

If I switch to the APM -> myService -> transaction page I see only two entries:

  • OperationHandler#handle
  • GET

The former is a Spring Boot Actuator request it was not able to identify. And GET contains all GET requests. In contrast

https://www.elastic.co/guide/en/kibana/6.7/transactions.html

has a nice list of the various paths where there are transaction names like "GET /api/stats".

Any ideas what could be wrong with my setup?

Thx, Remo

Hi and thanks for your question.

The Java agent uses the HTTP method name as a fallback transaction name whenever it can't determine a more appropriate one. If the request is handled by a Spring MVC controller, the transaction name is ControllerClassName#methodName. If the request is handled by a javax.servlet.Servlet, it is named ServletClass#doGet, for example. How does your architecture look like? Where do you handle your requests?

Another option which might be appropriate in your case is to use the URL path as the transaction name. Be aware of the caveats though.

I hope this helps :slight_smile:

Cheers,
Felix

Hi Felix

Thx for the configuration pointers! All makes sense. We make use of http://www.crnk.io/ for regular rest calls. In the end it is a servlet processing the requests. We now set the span name on our own accounting for the issues with IDs in URLs.

For Spring Boot Actuators I guess it would be something useful to support out-of-the-box. In our case they get called frequently by Kubernetes to perform health checks.

Thx, Regards Remo

I created https://github.com/elastic/apm-agent-java/issues/513 to may have some Spring Boot Actuator support out of the box. Seems something useful for anyone.

Thx for the help!

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