Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

Timestamps of telemetry items are not precise #1175

Closed
zakimaksyutov opened this issue Apr 18, 2019 · 2 comments
Closed

Timestamps of telemetry items are not precise #1175

zakimaksyutov opened this issue Apr 18, 2019 · 2 comments
Assignees
Milestone

Comments

@zakimaksyutov
Copy link
Member

If you are reporting bug/issue, please provide detailed Repro instructions.

Repro Steps

Have a few very fast sequential dependency calls (for instance to Azure Storage in the same region).

Actual Behavior

Since DateTime has 15-30 ms precision, many telemetry items start at the same time and appear to be running in parallel rather than sequential. This results in completely misleading End-to-end transaction view:

image

On top of it - since it is sorted by start time, the actual order is wrong too.

Expected Behavior

Sequential items must have different timestamps.

Here is a potential solution - remember timestamp during initialization, start a StopWatch and then get exact relative timestamp by adding duration to initial timestamp: https://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision/15008836#15008836

Version Info

SDK Version : 2.8.1
.NET Version : 4.6
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Visual Studio
OS : Windows
Hosting Info (IIS/Azure WebApps/ etc) : WebApp

@lmolkova
Copy link
Member

Here is the code that corrects timestamps for Activity on .NET Fx: https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.DateTime.netfx.cs

We should do the same in the base SDK for all telemetry items.

@cijothomas
Copy link
Contributor

@cijothomas cijothomas added this to the 2.10 milestone Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants