Skip to content
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

feat(zipkin-transport-http): configurable retry #485

Merged
merged 6 commits into from
Feb 24, 2020

Conversation

petermetz
Copy link
Contributor

Defaults to an exponential backoff with retrying always and forever.
All options are configurable through the constructor of the
HttpLogger class.

Goal: Do not lose traces if there was an intermittent network
connectivity issue in a browser environment for example.

Signed-off-by: Peter Somogyvari peter.somogyvari@accenture.com

@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 10, 2020

Hi @petermetz thanks for this great addition. In terms of the code it looks good to me tho we had a discussion about a similar issue and we went for this path (suggested by @adriancole):

My main request is if there isn't a library that could be used that has resilience mechanics built-in, then users pass that library. this seems like commodity HTTP retry stuff which makes it feel odd we should host and maintain that.

Hence my question would be, does it make sense to allow people to plug https://github.com/jonbern/fetch-retry instead of writing our own?

Defaults to an exponential backoff with retrying always and forever.
All options are configurable through the constructor of the
HttpLogger class.

Goal: Do not lose traces if there was an intermittent network
connectivity issue in a browser environment for example.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz
Copy link
Contributor Author

@jcchavezs Makes a lot of sense, thank you for the feedback! I swapped out the home grown retry logic with the library from your comment.
The code looks much simpler and yet, it achieves the same thing. Let me know what you think.

Also: missing parameter documentation added
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz
Copy link
Contributor Author

@jcchavezs Also made it fully pluggable here: 027b5f8

@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 16, 2020

@petermetz thanks a lot for this great improvement. The only things that bothers me a lot is that HttpLogger accepts ad-hoc options for fetch-retry, I don't think it is its responsibility and also couples us with fetch-retry, also I think it becomes cumbersome as it gives the feeling that you could just pass the retry arguments and it will work with regular fetch. Hence I opened a PR in fetch-retry that allows to pass those options in the builder which will allows us to still accepting a fetch object: jonbern/fetch-retry#39.

@petermetz
Copy link
Contributor Author

@jcchavezs Got it, makes sense. Let's see how that PR plays out then, I can keep this open in the meantime and update this one accordingly based on what happens to jonbern/fetch-retry#39

@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 22, 2020 via email

Based on the feedback from @jcchavezs here
openzipkin#485 (comment)

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Added test to check if the constructor parameter does as it is intended.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz
Copy link
Contributor Author

@jcchavezs Upgraded to 3.1.0 fetch-retry; simplified the constructor parameters as mentioned above and added an extra test + documentation with code examples on how to fully customize the fetch retry implementation:

…t and makes the fetch-retry a custom example.
@jcchavezs
Copy link
Contributor

Thanks for the great work @petermetz. I really appreciate your patience and enthusiasm.

I changed the PR to use the default fetch by default and added fetch-retry as an example. The main reason for this is that we should aim to provide the simpler/standard in the library but allow users to consciously extend the functionality of this library. Hence I kept the retry usage as an example.

@jcchavezs jcchavezs merged commit cddabe6 into openzipkin:master Feb 24, 2020
@jcchavezs
Copy link
Contributor

jcchavezs commented Feb 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants