microsoft / applicationinsights-react-js

Microsoft Application Insights React plugin
MIT License
35 stars 13 forks source link

Tracking api call #37

Open rkreddydl opened 1 year ago

rkreddydl commented 1 year ago

I am using telemetry to auto track events in reactjs v18 app. All the api calls are being tracked under dependency section How to track axios call in the logs > request query i.e. add request tag to it and view in logs > request instead of logs > dependency?

image

MSNev commented 1 year ago

Hmm,

I'll need to check with the back end team about what event name is routed to the "logs > request" (I'm assuming you mean this one, as this looks like it's for Server side requests only (which the Application Insights JS SDK never emits, because it's a client side SDK).

While technically, we "should" be able to emit an event in the correct format, I'll also need to check with the back end team on whether they would accept and route events from the SDK server entry point to that table (they should).

MSNev commented 1 year ago

@rkreddydl At this point in time it is not possible to have the dependency calls which are currently tracked as dependency redirected to the request table.

There are several tasks that would be required to support this as the request and dependency data schema's are different and therefore they can't simply be redirected.

So this will require that the JS SDK be updated to support the sending of request style events and once this is done you could either manually send request events or we could provide some form of optional mapping.

The timeframe for this work would not be for a while and would not be part of the v2 as it is now considered to be in major feature freeze as we are about to release v3 (current the beta).

I'll tag this issue as an enhancement, so it forms the basis for implementing a possible trackRequest capability.