1
votes

I've asp.net core 2.1 application, using app insights nuget:

<PackageReference Include="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" 
                  Version="2.1.1" />

In the azure portal, I can see failed request and the end to end transaction detail, e.g.:

enter image description here

Is it possible to see the response text which is more descriptive, or I need to log it manually?

Also on failed POST request, I would like to log posted data

1

1 Answers

0
votes

Application Insights SDK does not automatically collect the response body or Post params, but you can write TelemetryInitializers to add any additional properties you'd like collected. As long you can access the POST params or body or anything - you can attach it to the RequestTelemetry.

It's important to note that you may not be able to read response body twice, so you won't be able to add it to RequestTelemetry via TelemetryInitializer. In those cases, please try the answer below:

https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/686#issuecomment-388425295