Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EF Cosmos tracing data missing #7265

Open
1 task done
jjindrich opened this issue Jan 27, 2025 · 3 comments
Open
1 task done

EF Cosmos tracing data missing #7265

jjindrich opened this issue Jan 27, 2025 · 3 comments
Labels
area-integrations Issues pertaining to Aspire Integrations packages azure-cosmosdb Issues related to Azure CosmosDB
Milestone

Comments

@jjindrich
Copy link

jjindrich commented Jan 27, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have my sample Aspire application using Entity Framework using Cosmos SQL (noSQL) instance. This Aspire application hosts Blazor website.
When I check Trace log, I see only few requests to cosmos HTTP, not Cosmos query. Sometimes this data are missing completely.

Expected Behavior

I'm expecting to see dependency similar to http client.

Steps To Reproduce

There is sample app - https://github.com/jjindrich/jjweb-aspire-tracing
Add your CosmosDB connection string into appsetting.Development.json

Exceptions (if any)

No response

.NET Version info

.NET SDK:
Version: 9.0.200-preview.0.24575.35
Commit: 81b5f040be
Workload version: 9.0.200-manifests.9ad85b57
MSBuild version: 17.13.0-preview-24569-04+8f6b8ad0a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.200-preview.0.24575.35\

.NET workloads installed:
[aspire]
Installation Source: VS 17.13.35617.110, VS 17.12.35707.178
Manifest Version: 8.2.2/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Install Type: Msi

[maui-windows]
Installation Source: VS 17.13.35617.110, VS 17.12.35707.178
Manifest Version: 9.0.14/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.14\WorkloadManifest.json
Install Type: Msi

[maccatalyst]
Installation Source: VS 17.13.35617.110, VS 17.12.35707.178
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.1.9163\WorkloadManifest.json
Install Type: Msi

[ios]
Installation Source: VS 17.13.35617.110, VS 17.12.35707.178
Manifest Version: 18.1.9163/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.1.9163\WorkloadManifest.json
Install Type: Msi

[android]
Installation Source: VS 17.13.35617.110, VS 17.12.35707.178
Manifest Version: 35.0.24/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.24\WorkloadManifest.json
Install Type: Msi

Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.1
Architecture: x64
Commit: c8acea2262

.NET SDKs installed:
8.0.405 [C:\Program Files\dotnet\sdk]
9.0.102 [C:\Program Files\dotnet\sdk]
9.0.200-preview.0.24575.35 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Anything else?

No response

@davidfowl davidfowl added area-integrations Issues pertaining to Aspire Integrations packages azure-cosmosdb Issues related to Azure CosmosDB untriaged New issue has not been triaged labels Jan 28, 2025
@eerhardt
Copy link
Member

@AndriySvyryd - is there something specific we need to do for EF Cosmos to get the tracing to work?

I see in the non-EF code we have:

// Needs to be enabled for either logging or tracing to work.
clientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing = false;
if (!settings.DisableTracing)
{
builder.Services.AddOpenTelemetry().WithTracing(tracerProviderBuilder =>
{
tracerProviderBuilder.AddSource("Azure.Cosmos.Operation");
});
}

Do we need to do something similar in EF? If so, how?

@sebastienros sebastienros added this to the Backlog milestone Jan 30, 2025
@sebastienros sebastienros removed the untriaged New issue has not been triaged label Jan 30, 2025
@AndriySvyryd
Copy link
Member

We don't expose the DisableDistributedTracing option yet, the general issue is dotnet/efcore#35482

@jjindrich For now you can see SQL sent in the logs under the DbLoggerCategory.Database.Command category, they are Information-level.

@jjindrich
Copy link
Author

yes, but this commands are not corelated with request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages azure-cosmosdb Issues related to Azure CosmosDB
Projects
None yet
Development

No branches or pull requests

5 participants