ApplicationInsightsTelemetryEnhancer 2.2.0
See the version list below for details.
dotnet add package ApplicationInsightsTelemetryEnhancer --version 2.2.0
NuGet\Install-Package ApplicationInsightsTelemetryEnhancer -Version 2.2.0
<PackageReference Include="ApplicationInsightsTelemetryEnhancer" Version="2.2.0" />
paket add ApplicationInsightsTelemetryEnhancer --version 2.2.0
#r "nuget: ApplicationInsightsTelemetryEnhancer, 2.2.0"
// Install ApplicationInsightsTelemetryEnhancer as a Cake Addin #addin nuget:?package=ApplicationInsightsTelemetryEnhancer&version=2.2.0 // Install ApplicationInsightsTelemetryEnhancer as a Cake Tool #tool nuget:?package=ApplicationInsightsTelemetryEnhancer&version=2.2.0
Application Insights Telemetry Enhancer
Add data to Microsoft Azure Application Insights
Features
- Add Application Insights Operation Id as a response header to alll of your app's responses
- Add request and response body to Application Insights Request Telemetry. You will see the body of every incomming API call, and the HTML of every page view.
- Add request and response body to Application Insights Dependency Telemetry. You will see the body of every API call your app makes to external APIs.
ASP.Net support
Only .Net Core 2.2 and .Net Core 3.1 are currently supported
Usage
Operation Id Response Header
To add the operatrion id response header, add this line to the Configure
method in Startup.cs
app.UseOperationIdHeader();
The default header name is Operation-Id
In order to customize it, you can add a configuration section to your appsettings.json
file:
"OperationIdHeader": {
"HeaderName": "HeaderConfig"
}
After adding the configuration section, pass it in the following way in ConfigureServices
method in Startup.cs
:
services.AddOperationIdHeader(Configuration.GetSection("OperationIdHeader"));
Another way to customize the response header, is directrly in the ConfigureServices
method:
services.AddOperationIdHeader(options =>
{
options.HeaderName = "HeaderOptions";
});
Dependency Telemetry Enhancer
To add the request and response body of every external HTTP call, add this line to the ConfigureServices
method in Startup.cs
services.AddDependencyTelemetryEnhancer();
The default custom dimentions are "Request" and "Response".
In order to customize them, you can add a configuration section to your appsettings.json
file:
"DependencyTelemetryEnhancer": {
"RequestPropertyKey": "RequestConfig",
"ResponsePropertyKey": "ResponseConfig"
}
After adding the configuration section, pass it in the following way in ConfigureServices
method in Startup.cs
:
services.AddDependencyTelemetryEnhancer(Configuration.GetSection("DependencyTelemetryEnhancer"));
Another way to customize the custom dimentions, is directrly in the ConfigureServices
method:
services.AddDependencyTelemetryEnhancer(options =>
{
options.RequestPropertyKey = "RequestOptions";
options.ResponsePropertyKey = "ResponseOptions";
});
Request Telemetry Enhancer
To add the request and response body of every incomming HTTP call, add this line to the Configure
method in Startup.cs
app.UseRequestTelemetryEnhancer();
The default custom dimentions are "Request" and "Response".
In order to customize them, you can add a configuration section to your appsettings.json
file:
"RequestTelemetryEnhancer": {
"RequestPropertyKey": "RequestConfig",
"ResponsePropertyKey": "ResponseConfig"
}
After adding the configuration section, pass it in the following way in ConfigureServices
method in Startup.cs
:
services.AddRequestTelemetryEnhancer(Configuration.GetSection("RequestTelemetryEnhancer"));
Another way to customize the custom dimentions, is directrly in the ConfigureServices
method:
services.AddRequestTelemetryEnhancer(options =>
{
options.RequestPropertyKey = "RequestOptions";
options.ResponsePropertyKey = "ResponseOptions";
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Microsoft.ApplicationInsights (>= 2.14.0)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
For use with ASP.Net Core 2.2