Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.66k forks source link

[Storage] Dependency timestamps not accurate on .NET Framework #33146

Open Basvg opened 1 year ago

Basvg commented 1 year ago

I have upgraded our Azure storage packages to v12. However I have noticed that with the new version, the reported timestamps of the dependency tracking in Application Insights are not accurate. On our staging server, it shows a huge increase in duration:

afbeelding

This is not accurate however, because in reality they don't take that long. The duration of the operation itself is much shorter, as can be seen here:

afbeelding

I have set up a test API call like this:

public async Task<long> Test()
{
    var storageClient = new BlobServiceClient("connection string");
    var blobClient = storageClient.GetBlobContainerClient("test").GetBlobClient("test");

    var watch = new System.Diagnostics.Stopwatch();
    watch.Start();
    var test = await blobClient.ExistsAsync();
    watch.Stop();

    return watch.ElapsedMilliseconds;
}

The duration as shown in Application Insights is often much longer than the duration as measured by the stopwatch.

I have done some more testing by setting up a completely new project with just storage and application insights packages, and uploaded this to a new Azure App service.

Although the reported durations are not as high as in our actual application, the timestamps are still not accurate:

afbeelding

This only happens on .NET Framework 4.8, not on .NET 7. All packages were updated to their latest versions.

I have tried downgrading to older versions, and the problem also occurs in Azure.Storage.Blobs 12.0.0 using Azure.Core 1.0.0.

It seems like it happens with the Tables package as well, but I have not done any specific testing for that one.

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
I have upgraded our Azure storage packages to v12. However I have noticed that with the new version, the reported timestamps of the dependency tracking in Application Insights are not accurate. On our staging server, it shows a huge increase in duration: ![afbeelding](https://user-images.githubusercontent.com/2334483/208925073-33e1fc25-d40a-44be-8dcf-49af70c7c944.png) This is not accurate however, because in reality they don't take that long. The duration of the operation itself is much shorter, as can be seen here: ![afbeelding](https://user-images.githubusercontent.com/2334483/208931321-62856fad-4df4-4f84-8f4f-b7085859b720.png) I have set up a test API call like this: public async Task Test() { var storageClient = new BlobServiceClient("connection string"); var blobClient = storageClient.GetBlobContainerClient("test").GetBlobClient("test"); var watch = new System.Diagnostics.Stopwatch(); watch.Start(); var test = await blobClient.ExistsAsync(); watch.Stop(); return watch.ElapsedMilliseconds; } The duration as shown in Application Insights is often much longer than the duration as measured by the stopwatch. I have done some more testing by setting up a completely new project with just storage and application insights packages, and uploaded this to a new Azure App service. Although the reported durations are not as high as in our actual application, the timestamps are still not accurate: ![afbeelding](https://user-images.githubusercontent.com/2334483/208927363-282424ab-9bb1-4dce-8cfd-107d5a726575.png) This only happens on .NET Framework 4.8, not on .NET 7. All packages were updated to their latest versions. I have tried downgrading to older versions, and the problem also occurs in Azure.Storage.Blobs 12.0.0 using Azure.Core 1.0.0. It seems like it happens with the Tables package as well, but I have not done any specific testing for that one.
Author: Basvg
Assignees: -
Labels: `Storage`, `Service Attention`, `Client`, `customer-reported`, `question`, `needs-team-attention`
Milestone: -
navba-MSFT commented 1 year ago

Adding Service team to look into this.

@xgithubtriage Could you please look into this once you get a chance ?