apm-agent-java icon indicating copy to clipboard operation
apm-agent-java copied to clipboard

Add support for Spring Boot 4

Open pbartoszek opened this issue 11 months ago • 6 comments

I can see following exception when running latest java agent on Spring Boot 4 running java 25.

java.lang.NoSuchMethodError: 'boolean org.springframework.http.HttpHeaders.containsKey(java.lang.Object)'
	at co.elastic.apm.agent.resttemplate.SpringRestRequestHeaderSetter.setHeader(SpringRestRequestHeaderSetter.java:30)````

pbartoszek avatar Dec 23 '25 14:12 pbartoszek

I am very interested by this enhancement! Currently, I can't use Elastic APM agent on my Spring Boot 4 applications, that is really an issue for my application and my company. And some other applications do not migrate to Spring Boot 4, until Elastic APM agent is compatible.

fbaligand avatar Jan 05 '26 09:01 fbaligand

This should be supported by our EDOT agent

jackshirazi avatar Jan 05 '26 12:01 jackshirazi

@jackshirazi I just found on https://www.elastic.co/docs/solutions/observability/get-started/other-tutorials/tutorial-monitor-java-application info

We recommend using the [Elastic Distribution of OpenTelemetry (EDOT) Java SDK](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/java/setup) as the
preferred way to instrument your Java application. The EDOT Java SDK provides OpenTelemetry-based instrumentation and can send telemetry data to Elastic.

is this the case that for new integrations EDOT is preferred choice?

pbartoszek avatar Jan 05 '26 12:01 pbartoszek

Sadly EDOT is not a drop in replacement when runtime attach of the agent is necessary/preferred; in a JRE environment the Elastic APM Agent can attach while the EDOT agent cannot; so in that regard there is no feature parity

gpsmit avatar Mar 18 '26 12:03 gpsmit

Is there a plan when this can be released? We would also like to finish the spring boot update with a compatible APM agent.

akoessler avatar Mar 26 '26 13:03 akoessler

Same here, we would also like to use spring boot 4 with the APM agent.

michbeck100 avatar Apr 07 '26 08:04 michbeck100