-
Notifications
You must be signed in to change notification settings - Fork 784
log and return empty mono when WebClient request fails sending zipkin trace data #2170
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
Conversation
|
Yeah, looks like a good idea, I like it. |
|
Theoretically, if you add tests and we merge this soon, then it could be picked for today's release! |
|
I am not sure how to do this, to get the tests to work I have to implement the same behavior in Let me know if you have some other suggestions on how to solve this. |
|
Hmm come to think of it that's a breaking change. We want to know that there's sth wrong when trying to send the spans. Maybe we could change the logging level somehow but still point that the check result is not ok? WDYT? |
|
What if we made See the latest commit if this might be an option? |
|
What if instead of passing the error processing function we would give a function that would allow you to take in a private static void post(String url, MediaType mediaType, byte[] json, WebClient webClient, long checkTimeout, Function<Mono<ResponseEntity<Void>>, Mono<ResponseEntity<Void>>> function) {
return function.apply(webClient.post().uri(URI.create(url)).accept(mediaType).contentType(mediaType).bodyValue(json).retrieve()
.toBodilessEntity().timeout(Duration.ofMillis(checkTimeout)));
}That way we could inject some |
…mize the reactive flow
|
That is a really good idea, please have a look at the latest commit. |
|
That looks good! Now we need to ensure that the autoconfiguraiton is properly setup to include that function |
|
It should still work, right? Since I kept the old constructor and added a new one that included the function. By overriding this with your own bean it should be easy to add for example error handling or retries. |
|
Yeah, you're right. You'll just have to provide your own sender. |
|
Great job @jarlehansen ! This will be in Sleuth 3.1.4 unfortunately (we've just done the 3.1.3 release). |
|
Thanks @marcingrzejszczak, too bad we did not make the 3.1.3 release but it was a good idea to get the best implementation of this and not to rush it. Thanks for all the assistance on this feature. |
|
Yeah, I love how the cooperation on this issue looked like - an ideal open source contribution :) |
The implementation of
WebClientSendercan cause a lot ofOn error droppedstack traces if it is not able to send the trace data to the server. It is also difficult to handle these exceptions without a completely customSender. It would be better if the webclient handles the exception and logs the message, this avoid a lot of unnecessary error log that fills up the application logs.This is atm only a suggestion, if it seems like a good idea we also need to rewrite a couple of tests.