Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.    
 
The APM agent version 1.33.0 fails to start on JDK 20, which prevents the APM integration to work as expected. As a consequence, the tracing does not work.
When setting
ELASTIC_APM_LOG_LEVEL=debugandELASTIC_APM_LOG_FILE=/tmp/log.txt, the agent log shows that there is an issue with accessingUnsafe(sorry I don't have the exact stack trace).There was a few changes in APM agent regarding the security manager (SM) in recent versions, and updating the agent seems to make it work as expected.
However, there is one known caveat so far
(elastic/apm-agent-java#3074), keeping the agent with
debuglog level withELASTIC_APM_LOG_LEVEL=debugmakes it trigger another security exception when trying to establish connection with apm-server because the agent prints few details if a proxy is used or not (which is forbidden by default by the SM and isn't yet wrapped in a privileged call.Backport of: #94716