Closed zakimaksyutov closed 5 years ago
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.
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:
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