Application Insights Java Profiler April 2023 - Public Preview Update
Published Apr 27 2023 04:09 PM 6,568 Views
Microsoft

In October 2022, Microsoft announced the Public Preview feature of the Java Profiler feature. The Java Profiler feature allows Java developers and service owners to gather JDK Flight Recorder (JFR) recordings. A JFR recording is created and stored by Application Insights when the application breaches a user-defined SLA[1]. This recording is then ready for end users to download and inspect using tools like JDK Mission Control.

 

Since the Public Preview launch of the Java Profiler feature, we have added some additional functionality to enhance the end-user experience.

  • Java Profiling feature is enabled by default within the agent.
  • New profiling triggers based on Open Telemetry Spans.
  • Improvements to the discoverability of JFR recordings.

 

Java Profiling by Default

 

The Java Profiler capability is on by default for Agents at version 3.4.10+. End users must create SLA triggers to see the creation of JFR recordings for analysis.

 

New SLA triggers based on OpenTelemetry spans

 

The new Open Telemetry span SLA triggers allow users to trigger the collection of a Java profile on what are effectively business metrics.

 

For example, the service owner of a Java based ticketing system can add a trigger to create a JFR recording if the functionality to doesn’t meet performance expectations. In the example below, a trigger creates a recording when 95% of transactions take longer than 5000 ms (5s) over a 60000 ms (60s) time window.

 

  • Single endpoint selected by regex: /getusers/
  • Aggregation:
    • Calculate ratio of transactions > 5000 ms (5s)
    • Applied over a 60000 ms window (60s).
  • Threshold > 0.95 (95%) of requests breach threshold
  • Profile duration 30 seconds
  • Cooldown 60s

{

   "preview" : {

      "profiler" : {

         "enableRequestTriggering": true,

         "requestTriggerEndpoints" : [

            {

               "name" : "Users endpoint is responsive",

               "type" : "LATENCY",

               "filter" : {

                  "type" : "name-regex",

                  "value" : "/getusers/.*"

               },

               "aggregation" : {

                  "type" : "breach-ratio",

                  "configuration" : {

                     "thresholdMillis" : 5000

                  },

                  "windowSizeMillis" : 60000

               },

               "threshold" : {

                  "value" : 0.95

               },

               "profileDuration" : 30,

               "throttling" : {

                  "value" : 60

               }

            }

         ]

      }

   }

}

 

User Experience Improvements

 

It is now also easier to discover where Application Insights stores the JFR recordings for retrieval with the addition of further links in the UI.

 

martijnverburg_0-1682009109905.png

 

martijnverburg_1-1682009109910.png

 

 

We would love to hear from you

 

Please visit the Application Insights Java Profiler documentation for how to get started with the new OpenTelemetry span-based triggers and other guidance.

 

These new features will help Java developers and service owners reduce the Mean Time To Resolution (MTTR) for performance complaints on the transactions that matter to them!

 

We look forward to hearing more of your feedback!  Please drop us a mail at JavaO11y@microsoft.com

 

[1] For the technically curious, this mechanism integrates with our open-source JFR-Streaming library.

 

 

 

 

 

Co-Authors
Version history
Last update:
‎Apr 20 2023 09:54 AM
Updated by: