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

Can we get the MSSQL Queries in the Traces of SQL in Aspire Dashboard? #2532

Open
mm-kishanp opened this issue Jan 31, 2025 · 2 comments
Open

Comments

@mm-kishanp
Copy link

mm-kishanp commented Jan 31, 2025

Type of issue

Typo

Description

Hi
I am using the MVC project which is getting the data from SQL Server and returning it,
Below is my code for Adding the Detailed Logs for getting the SQL queries to my console.

Image

And As per this I can see the Console logs for all SQL Queries.

Image

But When I try to get the same Queries in the Traces of the Request then I dont see the actual Query in the traces, I want to get the Queries in traces so that I can see what Queries I am hitting when refreshing the page.

Image

I am looking for getting the SQL Queries in Aspire Traces, How do to that.

[Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/database/sql-server-integration?tabs=dotnet-cli%2Cssms

Content source URL

https://github.com/dotnet/docs-aspire/blob/main/docs/database/sql-server-integration.md

Document Version Independent Id

e2855af1-745d-49d6-cb31-f636920505c7

Article author

@IEvangelist

Related Issues

@davidfowl
Copy link
Member

In your code you turned off tracing. Why is that? (look at your call to EnrichSqlServerDbContext)

@mm-kishanp
Copy link
Author

mm-kishanp commented Jan 31, 2025

builder.EnrichSqlServerDbContext<ApplicationDbContext>(options => { options.DisableTracing = false; });
If I set it to true then it will not trace at all, and Default value is false, So even i dont set it it will be false always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants