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

Receiver and SenderContext #3293

Merged
merged 6 commits into from
Jul 18, 2022
Merged

Conversation

marcingrzejszczak
Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented Jul 14, 2022

With this change we are spiking complete removal of any http / messaging / rpc abstractions and leaving a ReceiverContext and RequestReply or FireAndForget SenderContext. That way we are able to propagate any content over the wire and we are not forcing any default tagging mechanism (other than the one to be backward compatible).

It turned out that we're not properly supporting OkHttp instrumentation so I had to rewrite it to use the Interceptor approach not the EventListener one (which simplified a lot of things too).

Migration guide:

  • If you were using HttpRequest & HttpResponse abstraction + the HttpClientContext and HttpServerContext you'll need to use the RequestReplySenderContext (for the client side) and RequestReplyReceiverContext (for the server side)

}
Object requestTag = request.tag();
if (requestTag instanceof Tags) {
return tagsToKeyValues(((Tags) requestTag).stream());
}
else if (requestTag instanceof KeyValues) {
return (Iterable<KeyValue>) requestTag;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unchecked: unchecked cast

Reply with "@sonatype-lift help" for info about LiftBot commands.
Reply with "@sonatype-lift ignore" to tell LiftBot to leave out the above finding from this PR.
Reply with "@sonatype-lift ignoreall" to tell LiftBot to leave out all the findings from this PR and from the status bar in Github.

When talking to LiftBot, you need to refresh the page to see its response. Click here to get to know more about LiftBot commands.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@marcingrzejszczak marcingrzejszczak marked this pull request as ready for review July 15, 2022 11:06
@marcingrzejszczak marcingrzejszczak changed the title WIP on Receiver and SenderContext Receiver and SenderContext Jul 15, 2022
@marcingrzejszczak marcingrzejszczak added this to the 1.10.0-M4 milestone Jul 15, 2022
@marcingrzejszczak
Copy link
Contributor Author

cc @bclozel (that will be the context that you requested for - if you extend from it then propagation will happen out of the box)

With this change we are spiking complete removal of any http / messaging / rpc abstractions and leaving a ReceiverContext and RequestReply or FireAndForget SenderContext. That way we are able to propagate any content over the wire and we are not forcing any default tagging mechanism (other than the one to be backward compatible).
It turned out that we're not properly supporting OkHttp instrumentation so I had to rewrite it to use the Interceptor approach not the EventListener one (which simplified a lot of things too).

Thing to consider: do we even need the transport.http package - should we remove it too? Those extend the Observation.KeyValuesConvention and could be provided by external libraries.
@marcingrzejszczak marcingrzejszczak merged commit 4aa1d4a into main Jul 18, 2022
@marcingrzejszczak marcingrzejszczak deleted the receiverAndSenderContexts branch July 18, 2022 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants