Java APM Client ErrorLoggingListener Issue

Today I simulate an overload of my app an expect an outofmemory error and an invocation of my UncaughtExceptionHandler.

But there's an issue in co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener

    public void onError(String typeName, ClassLoader classLoader, JavaModule module, boolean loaded, Throwable throwable) {
    if (throwable instanceof MinimumClassFileVersionValidator.UnsupportedClassFileVersionException) {
        logger.warn("{} uses an unsupported class file version (pre Java 5) and can't be instrumented. " +
            "Consider updating to a newer version of that library.", typeName);
    } else {
        if (throwable.getMessage().contains("Cannot resolve type description")) {
            logger.info(typeName + " refers to a missing class", throwable);
        } else {
            logger.warn("Error on transformation " + typeName, throwable);
        }
    }
} 

IMHO the listener should only listen and not supress exceptions. The entry of ErrorLoggingListener is not in my app logging and I can't see problems in ES logs after.

Here the logging if an OutOfMemory occured

        019-07-18 15:50:35.391 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.util.NestedServletException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:35.764 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.servlet.ModelAndViewDefiningException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:36.110 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.method.annotation.ExceptionHandlerMethodResolver
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:36.786 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.server.ResponseStatusException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:37.108 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.HttpRequestMethodNotSupportedException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:37.398 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.HttpMediaTypeNotSupportedException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:37.690 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.bind.MissingPathVariableException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:37.992 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.bind.ServletRequestBindingException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:38.279 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.web.bind.MissingServletRequestParameterException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:38.618 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation org.springframework.beans.ConversionNotSupportedException
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:50:39.201 [http-nio-21001-exec-9] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation co.elastic.apm.agent.impl.error.ErrorCapture
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18 15:51:04.431 [wmsGWScheduler-1] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation co.elastic.apm.api.NoopScope
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    2019-07-18T15:51:16,827 WARN  [Thread-0 (ActiveMQ-client-netty-threads)] [i.n.u.c.SingleThreadEventExecutor]: Unexpected exception from an event executor: 
    java.lang.OutOfMemoryError: GC overhead limit exceeded

How did you simulate the overload of your application? Note that this listener does not catch Throwables at any time, only those which occur when currently instrumenting a class.
However, it probably makes sense to re-throw OOMEs.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.