The documentation doesn't state it and I'd by default assume that APM's sample rate would only affect spans but not errors. But what I've recently observed was that a NullPointerException was thrown by JVM when trying to invoke a method on null reference in our code (i.e. it's in a package configured in elastic.apm.application_packages
), that exception bubbled up all the way to the controller and was not caught by our code. That exception didn't end up in the APM's Errors section. What might cause that and how can I make sure that all unhandled exceptions end up in the APM?
Something to note: we're using JAX-RS, we have an ExceptionMapper configured which renders exceptions mostly as a generic "Internal server error" response