-
Notifications
You must be signed in to change notification settings - Fork 138
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
Flags for customizing retry behaviour #82
Comments
Yes, this seems reasonable to me. |
One thing about the backoff options. I'd like to keep the flags to a minimum to start, and set sane defaults for the rest. If you have suggestions for better defaults than the current ones, we can discuss changing them. For now, I think the only real flag we would need is I prefer to not over-flag things. |
I agree with you on not exposing too many flags. My primary concern are metered connections, i.e. mobile data, in case the server is not reachable. As such I'd strongly prefer to have at least the minimum and maximum wait duration configurable ( As for the flag prefix I'm not sure whether |
For the naming convention, I would put this under the |
#83 implements the flags as discussed. Implementing unittests will take a few more changes which I'd like to do separately (experimental code exists already). |
This is a quick fix until PR prometheus-community#82 [0] has landed upstream. [0]: prometheus-community#82
I have a usecase where a retry every 5 seconds is excessive and would like to contribute customizations for the retries. The PushProx client currently hardcodes the timings for connection retries:
PushProx/cmd/client/main.go
Lines 211 to 217 in eeadbe7
The
github.com/cenkalti/backoff
package (documentation) provides an exponential backoff algorithm. I'd use that instead of the custom implementation and provide flags:--retry.initial-wait=<duration>
, default 50ms--retry.multiplier=<float>
, default 1.5--retry.max-wait=<duration>
, default 5s--retry.max-elapsed=<duration>
, default 0 (keep retrying forever, otherwise give up and terminate after given duration)The default behaviour would be comparable to what's currently implemented while permitting customization.
@SuperQ @brian-brazil Would you be happy with such flags?
The text was updated successfully, but these errors were encountered: