Configure New Relic For .NET Core 3.0 Application

Introduction

 
New Relic is a performance monitoring tool which supports .NET Framework and .NET Core and it works with .NET languages like VB.NET, C# and CLI. In this article you will learn how to configure a .NET Core 3.0 API application to send a metric to New Relic by deploying it in Azure web app services.
 
Prerequisites
  • Basic Knowledge in .NET Core web application
  • Azure subscription
  • New Relic account

Configuring New Relic for .NET Core 3.0

 
Create a new Relic account
 
If you don't have an existing New Relic account, click here for sign up to get a new license key which is used while configuring the New Relic for ASP.NET Core app.
 
After completing the signup process, do the login, in the landing page select the web agent in our case it is Microsoft .net, after selecting the web agent it will generate the license.
Configure New Relic For .NET Core 3.0 Application
 

Create or open a ASP.NET Core application

 
Create or open a ASP.NET Core application, in my case I created a new ASP.NET Core 3.0 application using ASP.NET Core web application template as shown in the below figure.
 
Configure New Relic For .NET Core 3.0 Application 
 
Install New Relic agent using NuGet package manager.
 
Configure New Relic For .NET Core 3.0 Application 
 
Go to newrelic.config file and add directory attribute,
 
<log directory="D:\Home\LogFiles\NewRelic" level="info" />
 

Deploy the application using Azure Web app service

 
Right click on the project and click on publish, in my case I created a new web app service to deploy the application. 
 
Configure New Relic For .NET Core 3.0 Application
 
Configure New Relic For .NET Core 3.0 Application
 
After the deployment, login into Azure portal and open the web app service which we created recently.
 
Navigate to configuration -> Application settings -> New application settings and add the following key and value pair.
 
CORECLR_ENABLE_PROFILING - >1
CORECLR_PROFILER-> {36032161-FFC0-4B61-B559-F6C5D41BAE5A}
CORECLR_PROFILER_PATH_32-> D:\Home\site\wwwroot\newrelic\x86\NewRelic.Profiler.dll
CORECLR_PROFILER_PATH_64-> D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
CORECLR_NEWRELIC_HOME-> D:\Home\site\wwwroot\newrelic
NEW_RELIC_LICENSE_KEY-> YOUR_LICENSE_KEY
NEW_RELIC_APP_NAME-> YOUR_APP_NAME, in my case I named it is as AspCoreApiApp
 
Configure New Relic For .NET Core 3.0 Application 
 
Finally save the changes, and restart the web app service.
 
Load the application in browser using the URL https://aspcoreapi.azurewebsites.net/weatherforecast.
 
Configure New Relic For .NET Core 3.0 Application
Now, open the New Relic dashboard, using the below link.
 
https://rpm.newrelic.com/
 
You can find your New Relic application --  click on it to see all the metrics which are sent from our application which are deployed using Azure web app service.
 
Configure New Relic For .NET Core 3.0 Application
 
From the above figure you notice the transactions which happened recently are listed in transactions section of the application dashboard, as like that it will give the insight of the other performance metrics like error rate, throughput and many more.
 
Reference
 
https://docs.newrelic.com/docs/agents/net-agent/azure-installation/install-net-agent-azure-web-apps#web-app-agent-settings
 

Summary

 
In this article we have seen how to configure the New Relic for ASP.NET Core 3.0 application which is deployed using Azure web app service.
 
I hope you have enjoyed this article. Your valuable feedback, questions, or comments about this article are always welcome.