cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exceptions showed in excepcions dashlet but never thrown

jcamps
Advisor

Hi all,

I see some exceptions in the exceptions dashlet and also in the pure path and my development team says they are never thrown, they are only created with "new" but never thrown.

After some research I found the following description in the Exceptions sensor group:

"The Exception Sensor instruments the exception's constructor to retrieve information about the exception's Throwable class, its message and optionally its stack trace elements. The instrumented constructor also retrieves information about exceptions that do not get "thrown" but are created via new."

So this explaint why I see the exceptions because just as the development team says, they are only created with "new" but never thrown.

Si two questions:

1.- Is that right?

2.- If yes, can i modify or parametrize Dyantrace to show/count only the exceptions thrown and not those created only?

Thanks! Josep Maria

4 REPLIES 4

harald_berger
Dynatrace Pro
Dynatrace Pro

Hi Josep Maria,

Yes this is correct. The exception sensor works by instrumenting the constructor of exceptions.

Unfortunately there is no way to alter this behavior.

best

Harry

Hi, I'm using the web version, is it possible to configure the sensor to exclude a specific exception from being captured?

There is an external library creating exceptions but not throwing them, which generates a lot of unused data in the Exception Analysis Dashboard.

Explicit Exceptions can be excluded by editing the profile -> Agent Group -> Sensor Configuration -> Exception Sensor and adding an exclusion rule. But be aware that you will receive no indication in AppMon that the excluded exception was ever thrown.

Joe_Hoffman
Dynatrace Champion
Dynatrace Champion

One thing to add to Harry's response: Creating a lot of exceptions that are never used is very wasteful of JVM resources. Object Creation is an expensive operation. I would argue to not exclude the exception but instead argue that the exception should not be created unless it's going to be thrown. An exception object pool might be considered if its really necessary to pre-create these objects. AppMon is really showing you an issue with the architecture, don't just ignore it, fix it.

As for counting only the exceptions that are thrown, you could create your own instrumentation of the throwing call and thus you could report the number of creations .vs. throws. Or in that case create the exclusion of the exception creation and still report the throws. But in this situation the throwing would not be handled as an exception (no attached stack, etc), but just a method invocation. But would give you what you want (almost).