Developing Custom Extensions for Satoris
Satoris, now freely available for download, comes with numerous built-in metering extensions. Some extensions adapt the engine to limit metering to particular software execution characteristics such as a particular code path or an environment condition. Others extend the data collection capabilities as well as allowing simplified integration with other tools and technologies. But it’s also possible to develop custom extensions around some well-defined extension points in the Probes Open API, which is fully supported by Satoris.
There are 5 ways to extend the metering engine using the Probes Open API.
- Instrumentation — instrumenting code blocks using the probe interface
- Implementation — replacing the engine via a service provider interface
- Interception — processing metering events with a custom interceptor
- Intelligence — employing custom measurement strategies to filter events
- Inclusion — introduce new resource meters to be metered by probes
Manual instrumentation can be employed alongside agent-based dynamic bytecode instrumentation (BCI) to create and fire custom probes for a run of code within a large method or embedding additional context within a name.
The entire implementation of the Satoris metering engine can be replaced by implementing the service provider interface and setting a system property.
To install the alternative implementation:
The metering engine can be further extended by intercepting the lifecycle of all metered firing probes. Simply register a factory class name and have it return an interceptor when a thread, context, is first metered by the engine.
To install a custom interceptor add the following to the Satoris config file.
What we attend to and what we decide to ignore is very much part of our intelligence. The same applies to application performance monitoring tools. One or more custom strategies can be injected into the metering engine in deciding whether to meter (measure and collect) the firing of a specific named probe at some particular point in time in the software execution.
To install a custom strategy add the following to the Satoris config file.
The metering engine comes with numerous built-in meters but it also provides an interface for registering custom resource meters — measures.
To install a custom measure add the following to the Satoris config file.
It’s also possible to include custom resource measures using event counters.