Since the APM tracing was merged I see lots of exception/error throwing in profiles for nodes that have no configuration for APM set up.
I think something needs to be fixed here to make the APM calls noops without configuration or so.

![image](https://user-images.githubusercontent.com/6490959/182830081-44b40d42-9b75-4436-958d-b67578fe27e3.png)

modules/apm/src/main/java/org/elasticsearch/tracing/apm/APMTracer.java
*     span.end();
     * }
     * }</pre>
     * This typically isn't useful in Elasticsearch, because a {@link Scope} can't be used across threads.
     * However, if a scope is active, then the APM agent can capture additional information, so this method
     * exists to make it possible to use scopes in the few situation where it makes sense.
     *
     * @param spanId the ID of a currently-open span for which to open a scope.
     * @return a method to close the scope when you are finished with it.
     */
    @Override
    public Releasable withScope(String spanId) {
        final Context context = spans.get(spanId);
        if (context != null) {
            var scope = context.makeCurrent();
            return scope::close;
        }
        return () -> {};
    }
    private void setSpanAttributes(ThreadContext threadContext, @Nullable Map<String, Object> spanAttributes, SpanBuilder spanBuilder) {
        if (spanAttributes != null) {
            for (Map.Entry<String, Object> entry : spanAttributes.entrySet()) {
                final String key = entry.getKey();
                final Object value = entry.getValue();
                if (value instanceof String) {
                    spanBuilder.setAttribute(key, (String) value);
                } else if (value instanceof Long) {
                    spanBuilder.setAttribute(key, (Long) value);
                } else if (value instanceof Integer) {
                    spanBuilder.setAttribute(key, (Integer) value);