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

Getting information if CosmosDB returns 429 #618

Closed
sovaska opened this issue Aug 1, 2019 · 5 comments
Closed

Getting information if CosmosDB returns 429 #618

sovaska opened this issue Aug 1, 2019 · 5 comments

Comments

@sovaska
Copy link

sovaska commented Aug 1, 2019

Feature req: Getting information (callback/event/?) if CosmosDB returns 429 (not enough RUs available) so that number of RUs can be increased based on real use instead of questimate.

It would be nice to get callback/event if current RUs is too low. This would help to optimize performance and cost of CosmosDB.

@j82w
Copy link
Contributor

j82w commented Aug 1, 2019

One solution you can do now is use the new handler pipeline. All the request in v3 go through this handler pipeline. You can monitor 429s from the handler and have it do a call back if necessary. Check out the samples. One thing to note is this handler is before the retry handlers. Meaning that the handler will only see 429s that exceed the retry count.

@sovaska
Copy link
Author

sovaska commented Aug 1, 2019

Thanks, already tried to use custom handlers, but the problem is that handler will get 429 only after retry count has been exceeded... I would like to get information when first 429 is returned so that I could increase RUs to get rid of 429s...

@j82w
Copy link
Contributor

j82w commented Aug 1, 2019

Another solution would be to use the Azure Monitoring SDK to check if there is any 429s and scale using that. Then write an Azure function to run it every so often.

@j82w
Copy link
Contributor

j82w commented Aug 14, 2019

@simplynaveen20 will diagnostics have the info for this?

@j82w
Copy link
Contributor

j82w commented Aug 11, 2020

CosmosDiagnostics includes this information.

@j82w j82w closed this as completed Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants