Azure Web App
This guide walks you through instrumenting Google Cloud Run with Middleware APMs (Application Performance Monitoring). These instructions can also be found on the Installation page in your Middleware Account.
Introduction
Middleware Application Performance Monitoring (APMs) with Google Cloud Run enables tracing and monitoring for applications. This integration provides valuable insights into application performance and behavior, enhancing observability in a Azure Web App environment.
Prerequisites
- .NET 6+:
Check your .NET version with the following command:
dotnet --version
Features Supported
Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
✅ | ✅ | ✖ | ✅ | ✖ |
Installation
1 Install the Required Package
Add the Middleware package to your .NET project by running the following command using CLI:
dotnet add package MW.APM
If you are using Visual Studio IDE in Windows, then you can install it by going to below given path.
PATH - Tools > Nuget Package Manager > Manage Nuget Packages for Solutions > Browse
Now, search for MW.APM and Install the nuget package.
2 Add Code Configuration
Add the following code to your Program.cs
file:
Program.cs
var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables() .Build(); builder.Services.ConfigureMWInstrumentation(configuration); builder.Logging.AddConfiguration(configuration.GetSection("Logging")); builder.Logging.AddConsole();
3 Configure Your Middleware Account Information
Add the following to your appsettings.json
file:
"MW": { "ApiKey": "<MW_API_KEY>", "TargetURL": "https://<MW_UID>.middleware.io:443", "ServiceName": "<service-name>", "ProjectName": "<project-name>", "ConsoleExporter": "true", "ExcludeLinks": "[\"https://localhost:3000/health\"]", "ApmCollectMetrics": "true", "ApmCollectTraces": "true", "ApmCollectLogs": "true"
If you want to know more about all 2 methods and its attributes. You can refer this link
This is a one-time configuration. After these configuration changes are made, each time the Azure Pipeline will run, the .NET instrumentation will also run.
Need assistance or want to learn more about Middleware? Contact our support team in Slack.