Skip to end of banner
Go to start of banner

Exception sensor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Unknown macro: {float}
Contents

Exception sensor

The Exception sensor is used to gather information about exceptions in an application. The Exception Tracer is able to trace created, thrown, and handled exceptions within a target application. The Exception Tracer gathers information about methods and constructorsthat can cause an Exception. It must be specified which classes should be instrumented. There can be as many Exception Tracer configurations defined as you like.

Configuration

To enable the Exception Tracer, the name together with the fully-qualified-name of the class to instrument must be defined. As an optional parameter it is possible to enable superclass or interface matching support. The Exception sensor name must always be defined as exception-sensorin the configuration file, so there is no need to write down the fully-qualified name of this sensor type. There is no limit in how manyexception-sensor configurations can be defined. When defining multiple exception-sensor lines, there is always only one Exception Tracer created, which has one or more configurations.

exception-sensor [Exception Class] [options]

In contrast to method sensor types where the definition will provide the name of the class/method on which the sensor is to be applied, the exception sensor needs the name of the Exception class that should be traced.

The exception sensor is able to use Wildcards (see [ARCHIVE:Agent configuration]) for the definition of the class name. The options can be used to define that the provided exception class should be treated as interface or superclass (see the superclasses and interfaces chapter in [ARCHIVE:Agent configuration]).

Examples

The next table provides samples of how the exception tracer can be used. Bear in mind, that you can define multiple exception-sensors.

Configuration

Description

exception-sensor java.lang.Throwable superclass=true

Classes are instrumented that directly or indirectly extend java.lang.Throwable. The class java.lang.Throwable itself is not instrumented.

exception-sensor my.package.exception.MyException

Only the class my.package.exception.MyException is instrumented.

exception-sensor my.package.ex*.*Exception

All classes are instrumented that match the pattern (like my.package.exception.ParserException and my.package.extension.ExtensionException).

exception-sensor my.package.exception.IException interface=true

All classes are instrumented that are implementing the interface my.package.exception.IException.

exception-sensor my.package.exception.My*Exception

Classes like my.package.exception.MyException and my.package.exception.MyTestException are instrumented.

exception-sensor *

Every class of type Throwable is instrumented.

exception-sensor my.pack*.ex*.* superclass=true

Classes are instrumented which are extending the class that matches the pattern my.pack*.ex*.*

  • No labels