About Custom Metrics
You can supplement the existing metrics in the AppDynamics Controller UI with your own custom metrics. Like built-in metrics, your custom metrics are subject to the following AppDynamics features:
- automatic baselines and anomaly detection
- availability for display on custom dashboards
- availability for use in policies
- visibility of all metrics in the Metric Browser, where you can display external metrics along with AppDynamics metrics on the same graph
To create custom metrics, you create a monitoring extension. In your extension, you define the name and path of your metric (where it appears in the metric browser tree), what type of metric it is (sum, average, and so on), and how the data for the metric should be rolled up as it ages.
A custom metric can be common across nodes or associated with a specific tier. When you create a metric, you specify the path in which it will appear in the metric tree. To make a common custom metric, use the root tree path Custom Metrics in your metric declaration. To make a tier-specific metric, specify the metric path associated with that component. For details, see the topics on creating Java or Script-based custom metrics listed below.
Type of Monitoring Extensions
You can implement custom metrics using the following mechanisms.
- Using a script: You can write a shell script (LINUX) or batch file (Windows) to report custom metrics every minute to the Standalone Machine Agent. The Standalone Machine Agent passes these metrics on to the Controller.
For more information, see Build a Monitoring Extension Using Scripts.
- Using Java: Your custom metrics may be too complicated to collect using a script. For example, you may need to perform complex calculations or call a third party API to get the metrics. In this case you can extend the JavaServersMonitor class to collect the metrics and report them to the Standalone Machine Agent. Your Java program extends the JavaServersMonitor class to provide your custom functionality.
See Build a Monitoring Extension Using Java.
- Using HTTP: If you enable the agent HTTP listener, you can post HTTP requests to the Standalone Machine Agent to send it custom metrics every minute. This is done by starting the Standalone Machine Agent with a Jetty HTTP listener.
See Standalone Machine Agent HTTP Listener for information on starting the HTTP listener and sending it metrics.
- Using Performance Counters in a .NET environment: You can add additional performance counters to the standard hardware metrics reported by the embedded .NET Embedded Machine Agent by configuring the <perf-counters> element in the .NET Embedded Machine Agent's application.config file.
See Enable Monitoring for Windows Performance Counters.