ApplicationInsights-node.js icon indicating copy to clipboard operation
ApplicationInsights-node.js copied to clipboard

Event timestamps are at track time rather than at event start time

Open OsvaldoRosado opened this issue 8 years ago • 3 comments

See: https://github.com/Microsoft/ApplicationInsights-node.js/blob/develop/Library/EnvelopeFactory.ts#L83

This makes the timeline view of dependencies for requests show dependencies occurring before the start time of the request.

OsvaldoRosado avatar Oct 20 '17 18:10 OsvaldoRosado

Related to https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/658

OsvaldoRosado avatar Oct 20 '17 18:10 OsvaldoRosado

This would be awesome to get fixed - it makes tying the relationship between requests and dependencies near impossible as the times are simply not accurate! See below for an example where I have tracked express middleware as dependencies and the request apparently occurs after the middleware which are called as a result of the request! 😄

incorrect_request_time

asos-craigmorten avatar May 03 '20 11:05 asos-craigmorten

For anyone still having this issue, I've found a way to use it properly if you are using trackRequest (might work for other methods but I haven't check)

You can pass the variable time (JS Date) in the trackRequest method which will be used at the start time of the request on app-insights.

jeromewir avatar Dec 07 '21 14:12 jeromewir