Version 1.17.0 of the OpenTelemetry Java SDK was released a few days ago, and this release includes a fix for the performance bug identified in https://github.com/elastic/elasticsearch/issues/89107. We should upgrade to the latest version and revert the workaround introduced in https://github.com/elastic/elasticsearch/pull/89135.
modules/apm/src/main/java/org/elasticsearch/tracing/apm/APMTracer.java
private static final Logger logger = LogManager.getLogger(APMTracer.class);
    
    private final Map<String, Context> spans = ConcurrentCollections.newConcurrentMap();
    private volatile boolean enabled;
    private volatile APMServices services;
    private List<String> includeNames;
    private List<String> excludeNames;
    
    private volatile CharacterRunAutomaton filterAutomaton;
    private String clusterName;
    private String nodeName;
    public void setClusterName(String clusterName) {
        this.clusterName = clusterName;
    }
    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }
    /**
     * This class is used to make all OpenTelemetry services visible at once
     */
    record APMServices(Tracer tracer, OpenTelemetry openTelemetry) {}