-
-
Notifications
You must be signed in to change notification settings - Fork 724
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
Middleware around resty.Request.Execute including retries #788
Comments
@rob0rt Thanks for reaching out and proposing suggestions. It does make sense. I'm putting my effort into v3. |
@rob0rt I'm in the Resty v3 active development. I wanted to check if you got a chance to try the functions above. |
@rob0rt In the upcoming v3, Can you please explore the newly redesigned flow on middleware and in combination with RetryHook? Then share your feedback.
|
I'm closing it. Upcoming v3 docs is here https://resty.dev |
I'm in the process of instrumenting one of my applications with OTel, and was able to inject the OTel tracing client through
resty.NewWithClient(otelhttp.DefaultClient)
which gives me spans around each individual request (similar to resty'sOnBeforeRequest
andOnAfterRequest
), but it would be nice if I could wrap all of the requests made with my resty client with a singular span that encompass all retries.In practice, I think this would look like adding a middleware dispatch at the beginning and end of
request.go:Execute
(https://github.com/go-resty/resty/blob/v2/request.go#L900-L968)I don't have any good suggestions for naming, but maybe something like
OnBeforeRetryableRequest
andOnAfterRetryableRequest
?This would, concretely, allow me to instrument my resty client as follows:
which might product a trace like the following:
Currently this is possible, but requires instrumenting all individual usages of the resty client as follows:
Having to do this at all callsites isn't impossible, but it would be nice to make it implicit behavior for my resty client instance.
The text was updated successfully, but these errors were encountered: