-
Notifications
You must be signed in to change notification settings - Fork 43
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
Retry mechanism behaves incorrectly when HTTP 429 is returned by Datadog #1923
Comments
Hi, Can you share the script that you're using? It does work as expected for a simple script that I tried. Thanks. |
Hi @therve I managed to reduce the script to this short version below. We have 70+ dashboards now and if I start the script right at the start of a minut (e.g. 12:05:01), then rate limit runs out after ~40 seconds. If I wait a bit and start script at e.g. 12:05:40, then script finishes with success. I see in debug logs, that in the latter case rate limit gets back to
|
That's very weird. What's your python version? And your urllib3 version? |
Script executed on macOS with:
|
Thanks for your contribution! This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. If you would like this issue to remain open:
|
Describe the bug
Summary:
Script which fetches all dashboards in the loop exits with an error, when rate limit runs out, even though
enable_retry
option is turned on. According to debug logs, script exits on first HTTP 429 returned, with no retry attempted.Details:
We have a script, which runs every night to fetch all dashboards from Datadog. It does it by fetching list of dashboards, and then goes one after another to fetch details of each one. After number of our dashboard grew, we have run into
HTTP 429
errors due to Datadog's rate limit.We decided to use retry option, which is built into the library since 2.16.0, but it seems it's not ready to how Datadog responds in case of hitting rate limit.
When I started the script in a loop with
debug
option enabled I see that Datadog returnsHTTP 200
up until the moment when rate limit is reached, then next request getsHTTP 429
(API Keys removed from logs below):To Reproduce
See description above
Expected behavior
I expect library to sleep for
x-ratelimit-reset
time, just like it's described in tests, which introduced this functionality. Right now I need to add a sleep between requests to API as a workaroundScreenshots
N/A - logs attached
Environment and Versions (please complete the following information):
client library version 2.23.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: