Azure App Service - monitoring application behavior (and using custom metrics)
When you are responsible for managing applications in production monitoring all aspects of application behavior is paramount.
Azure Applications Insights provides easy-to-use mechanisms for monitoring standard (e.g. CPU/memory/threads) and custom metrics. Custom metrics are often-underutilized but are actually extremely useful (e.g. monitor data arrival rates and values arriving from external input sources and raise alerts if data stopped coming).
Configuration of Java applications can be a little more involved therefore pre-configured java application is provided in GitHub.
In Application Insights select the resource that you would like to monitor and have CPU/memory utilization and application response time at your fingertips
Special thanks to Eugene Selivanov for providing example below:
The example Java source code is provided here.