Linux Java App Service performance monitoring with Java New Relic agent

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

When running your Java application in Azure Linux App Service, you may encounter performance related issues like high memory consumption, slow dependency calls, etc.
Java New Relic agent is one of the APM tools that can help to provide a better understanding of what may be causing the performance issues.

This article shows a demonstration of how to use New Relic agent to monitor your Java application running in Linux App Service.



  • A New Relic account.
  • Azure App Service for Linux with built-in Java docker image.


Setup and Enable Java New Relic agent

Download Java Newrelic agent: 

Upload the downloaded file to your Azure App Servic:

  1. Inside the App Service /home/site/wwwroot folder, create a new "apm" folder
    - Go to https://<webapp-name>
    - Use the following command to create a new /home/site/wwwroot/apm folder





mkdir -p /home/site/wwwroot/apm







2.  Upload the file to /home/site/wwwroot/apm



3. Decompress the /home/site/wwwroot/apm/






cd /home/site/wwwroot/apm/ unzip









Create Newrelic API keys 

Now we need to get the Newrelic API keys by navigating directly to
1. Create "Ingest-License" key in


2. Copy the new create API key, save it in your local notepad.



Configure your Newrelic setting in Azure App Service

1. Go to App Service WEBSSH https://<webapp-name>




vi /home/site/wwwroot/apm/newrelic/newrelic.yml








2. Input your Newrelic API Key and



Use ":wq" save the change.


3. In the App Settings, add "JAVA_OPTS" with Newrelic java agent path.
    JAVA_OPTS = -javaagent:/home/site/wwwroot/apm/newrelic/newrelic.jar


   Save the Application Settings change and web app should be automatically restarted.


Monitor your Java Application Performance in Newrelic

Go to 
Click "Explorer" tab, in the "Service - APM", we should see your java app showed up in the list. The Name should match your app_name configured in newrelic.yml.



1. Monitor the Application performance Summary.



2. Monitor JVM Memory usage



3. Monitor "Service Map" and "Dependencies"


List all the dependencies



Check most time consuming external services



4. Run Thread profiler
Set profiling Duration, and click "Start profiler"


When the profiling starts, run test over your Java App Service.

For example: send requests to https://<webapp-name> 


After the profiling completes, you will be able to click "View the results"




REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.