Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View Request Body in Application Insights

I'm using Application insights with API-Management to monitor my API's. Application Insights is great tool but I'm not able to see body.

I want to see Post request body parameter. Is there any way to add body data on application insights??

like image 690
Pankaj Rawat Avatar asked Mar 16 '18 05:03

Pankaj Rawat


People also ask

How do you log and request body response to application Insights?

Goto your Application Insights resource and navigate to Investigate > Transaction Search . Optionally set Event Types = Request and click on one of the logged items. You will end up with a view like this showing our custom properties which we defined as RequestBody and ResponseBody .

How do I view application log Insights?

View logs in Application InsightsGo to Application Insights resource in your resource group. Go to Logs under Monitoring section. Click on traces eye button to get log traces. Select Time Range and click Run.

How do I see exceptions in application Insights?

Open the Application Insights Search telemetry window in Visual Studio. While debugging, select the Application Insights dropdown box. Select an exception report to show its stack trace.

How do I monitor my Azure application Insights?

The easiest way to get started consuming Application insights is through the Azure portal and the built-in visual experiences. Advanced users can query the underlying data directly to build custom visualizations through Azure Monitor Dashboards and Workbooks.


2 Answers

You have to configure API Management to log the request payload to Application Insights. See here: Enable Application Insights logging for your API

  1. Navigate to your Azure API Management service instance in the Azure portal.
  2. Select APIs from the menu on the left.
  3. Click on your API.
  4. Go to the Settings tab from the top bar.
  5. Scroll down to the Diagnostics Logs section.
  6. Check the Enable box.
  7. Select your attached logger in the Destination dropdown.
  8. Input 100 as Sampling (%) and tick the Always log errors checkbox.
  9. Under Additional settings, configure up to 8192 bytes of the payload to be logged.
  10. Click Save.
like image 84
Sam Rueby Avatar answered Sep 23 '22 13:09

Sam Rueby


I can't do code changes in existing api. any option without code change would help me

Unfortunately, it is not supported by Application Insights.

I also find the feedback, you could vote it.

It now supports custom Telemetry Initializer as I have shown to you.

like image 41
Joey Cai Avatar answered Sep 25 '22 13:09

Joey Cai