If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 
TIP 1: select at least one tag that further categorizes your topic. For example server
for APM Server related questions, java
for questions regarding the Elastic APM Java agent, or ui
for questions about the APM App within Kibana.
TIP 2: Check out the troubleshooting guide first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.
APM Agent language and version: Java 17 and Elastic APM 1.53.0
Steps to reproduce:
- When I try to attach the apm agent to my spring boot 3.4.2 version, all transactions shown in request tab are GET UNKNOWN route or POST unknown route
- I suspect APM is not able to attach the spring MVC agent.
- the transactions are correctly shown in custom tag but not in request. I have tried both enable_type_matching_name_pre_filtering and enabling disabling servelt-api and spring mvc agent via attach properties.
Errors in browser console (if relevant):
Provide logs and/or server output (if relevant):
Hi,
This might be a limitation of the APM Java agent with current version of Spring boot.
Could you provide a very simple sample spring-boot application that allows to reproduce the issue ? Without this it might be quite hard for us to investigate further the issue you reported.
As an alternative, I would suggest to attempt using the EDOT Java agent which is based on OpenTelemetry, as it likely provides a more extensive support for Spring-Boot applications.
If the issue persists with EDOT, then it means the issue is not related to the application instrumentation but is likely with the data ingestion.
thanks @Sylvain_Juge is there a way to replace my APM configuration class in spring boot application to switch to EDOT, I coudnt find an article on spring boot migration.
The nearest match I found is Setup | EDOT but was wondering is there something for spring boot.
This is not yet in the main documentation, but we provide a runtime-attach
artifact that allows an easy setup with spring-boot. In addition this includes the agent in the application and you don't have to deal with -javaagent
JVM argument.
The documentation is available here: elastic-otel-java/runtime-attach at main · elastic/elastic-otel-java · GitHub
@Sylvain_Juge Perfect it works for us, I explored the runtime-attach, it works for us...the only issue I see currently is not getting the controller and service level trace in the transaction, goes from HTTP request to DB, might be we need to explore instrumentation options but we agree this as a way forward.
Can you elaborate what do you mean by that ?
- do you see any transactions when doing HTTP requests on your application ?
- what kind of transactions do you observe in Kibana UI ? Maybe provide a screenshot to make it more clear.
SO we miss the controller service layer flow, is that something we can customise.
Here do you mean the spring controllers or the internal application "business logic" ?
The spring controllers instrumentation is enabled by default, and if you look at the transaction metadata you should see in the attributes which instrumentation created the spans/attributes.
Given your screenshot, I am assuming that you need to know what is happening in your application within the 96ms of the POST /products
that are not spent on the 1.1ms postgres
database call, is that correct ?
The instrumentation agent only instruments the supported libraries and frameworks, which does not include the application internals as the agent can't guess the application architecture.
What you could try though is to use inferred spans feature by setting OTEL_INFERRED_SPANS_ENABLED
environment variable to true
, this will use a sampling profiler and generate all the intermediate spans without prior knowledge of the application architecture.