Application Insights Dependecy Tracking for HTTP calls to outside APIs

Marko Žlogar 6 Reputation points
2020-10-16T07:35:55.02+00:00

We have ASP.Net Core 3.1 app and added Application Insights Middleware to track request and response bodies from this article
app-insights-logging-middleware

This works fine for request, but we cannot track all the data we make from server-side to outside APIs. App Insights Dependency tracking only collects basic data, but we wanna capture all the data (POST body, request body, response body...).

This is data from POST call to Klaviyo API. There is no information on what data was send in the request body and no data that was returned in the response body.

32796-klaviyo.png

Thank you

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,825 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,953 questions
{count} vote

2 answers

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 17,726 Reputation points
    2020-10-20T12:26:17.2+00:00

    @Marko Žlogar Kindly note Application Insights currents supports a list of dependency calls automatically without any modification to your code. For currently supported list of dependency calls, refer this document.

    As Klaviyo API is not in the list of supported dependency calls, you need to track it using TrackDependency call. This document provides sample examples on how to track dependency calls manually.

    Kindly go through the reference documents and make changes to your application accordingly.


  2. Wilko van der Veen 0 Reputation points
    2023-02-01T07:11:34.5066667+00:00

    How does this work for libraries like RestSharp, which incorporates HttpClient but does its own management (e.g. does not use dependency injection for it) it seems that dependency tracking does not work out of the box for such libraries

    0 comments No comments