Closed thyandrecardoso closed 1 month ago
Yeap, I think the change makes sense. My only concern is whether the list of status codes that can be retried should be expanded/reduced. Is there any official Datadog documentation about when a client could/should retry requests?
Well, I found these:
I was unable to find anything in the official docs though :(
Nonetheless, the current list in this PR looks okish. We can also move these retriable status codes into configuration, but as we only have 1 endpoint and 1 verb being used against the public api, seems unlikely we will ever want to tweak those... 🤔
This proposes adding some retries when Datadog responds with certain status codes. We're using Datadog API reporter and it is frequent to have some transient failures, which is the motivation for these changes.
I've also considered dealing with some
Failure
s but, besides making testing harder, it is also not clear if those correspond to situations where the server did not receive the request at all and, thus, we might be duplicating data.So, having retries only for the success case of the request and work with HTTP status codes seemed more sensible.
What do you think, does this make sense?