-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Hooks #875
Hooks #875
Conversation
|
#501 notes that retries are noisy. Should we have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I don't think any of my comments are required changes.
It's a clever way to handle the different types of requests with a single function. It took me a bit of time to put all pieces together, so maybe an explanation or a complete example in the module header might be nice. Also, as usual for hooks, a diagram might be a good addition for documenting stages in a visual way. |
5b1a43f
to
fe5da09
Compare
I intend to merge this in the next couple of days - last call for comments. I'm interested to hear:
|
4618ec7
to
295b0e6
Compare
@endgame For
Then the user may define some fine-grained logic to control errors in retry, such as increasing the alarm level when retry times increase or timing out at some point |
Yeah I agree that the |
And reimplement logging in terms of the hooks API.
Keep all errors running through a single hook, so that `silenceError` does actually silence all errors.
I agree that we should consolidate error hooks, and have done so. (This is also necessary to make a single use of I think we avoid pushing too many additional parameters into the error/retry hooks at this stage. Instead, let's wait and see what people actually want, and work out the best way to give that to them. Otherwise, I fear we will add things for use-cases that nobody wants, and bind ourselves to maintaining them. |
BTW, once this one is merged I'll setup our XRay tracing to cover AWS service calls via that hooks. Quite happy about the new feature. Before I was doing a wierd "custom send" function based tracing of these that never was scalable on the developer overhead axis. |
@mbj Is there anything here that's missing for your use case? While I'm planning to ship the hooks as "officially experimental", it would be good to at least be able to support known use cases. |
@endgame on early inspection its what I need, but I cannot know for sure till I ported my ugly wrapper around |
@mbj Normally I'd ask people to test a PR branch so I have some confidence that merging it is going to be fine, but in this case I think merging now and testing its features is probably the way to go. Can you please let me know (via issue) whether or not the hooks are letting you do the things you want to do? |
Add a system of request/response hooks, to allow fine-grained customisation of the request lifecycle. The main module that you should read is
Amazonka.Env.Hooks
(which is so big that GitHub "helpfully" collapses it), and I have reproduced its synopsis below:Pretty much everything else is plumbing. Shout out to @axman6 for design help with this.
Ping @Fuuzetsu who raised the original issue about silencing exceptions.
Fixes #584
Fixes #501
Closes #737