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

HELP: How to enable query logging - want to see query being generated for Comos DB #2430

Open
golfalot opened this issue Oct 15, 2024 · 5 comments
Labels

Comments

@golfalot
Copy link

Expected behaviour dab start --LogLevel Debug would emit queries being generated (posted to /graphql)

dab --version
Microsoft.DataApiBuilder 1.2.11+c7ca8db8558a63919c530e454c8f18b45d5b931c

Things I've looked for / tried

Thanks
Tim

@golfalot
Copy link
Author

Am I possibly not seeing a query because there isn't one generated because ReadItemAsync is being used ? ref: #2399

@sourabh1007
Copy link
Contributor

I don't think, you can see the query generated by DAB and for point operation like above, dab doesn't even generate the query.

@golfalot
Copy link
Author

golfalot commented Oct 20, 2024

It sure would be helpful / reassuring to observe the execution plan in the debug output where I'd like to see either the query or the point operation(s) being executed.

In my current use case it's about pre-empting performance / RU consumption at the design stage for the solution we intend to deploy using dab.

I certainly foresee a situation where such logging would be highly valuable for troubleshooting after deployment too if Cosmos usage costs get high.

There is no Logger currently available in CosmosQueryEngine.cs to emit the debug messages I'd like to see.

@JerryNixon
Copy link
Contributor

Would including the query in the logs introduce a possible security issue?

@golfalot
Copy link
Author

Good thinking! We'd need to redact the literals from the query, much easier for point queries than SQL... Certainly an interim solution to simply indicate whether point or SQL is being used for Cosmos would be great.

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

No branches or pull requests

4 participants