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

Implement support for unary interceptor chaining. #152

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

klihub
Copy link
Member

@klihub klihub commented Jul 24, 2023

Add WithChainUnaryClientInterceptor and WithChainUnaryServerInterceptor client and server options. These allow registering more than one client and server side interceptor which then get chained and invoked in the order of registration.

This should allow us to implement opentelemetry instrumentation for unary calls as unary interceptors while allowing users to keep intercepting their client and server side ttrpc calls for other reasons at the same time. These commits were split out from #145.

@klihub klihub force-pushed the devel/unary-interceptor-chaining branch from acdf1cf to 342716c Compare July 24, 2023 14:42
@klihub klihub requested review from estesp and fuweid July 24, 2023 14:47
@klihub klihub force-pushed the devel/unary-interceptor-chaining branch 2 times, most recently from ac67b22 to db08a00 Compare August 7, 2023 07:59
client.go Outdated Show resolved Hide resolved
config.go Outdated Show resolved Hide resolved
client.go Show resolved Hide resolved
config.go Show resolved Hide resolved
Add a WithChainUnaryClientInterceptor client option to allow
using more that one client call interceptor which will then
get chained and invoked in the order given.

This should allow us to implement opentelemetry instrumentation
as interceptors while allowing users to keep intercepting their
client calls for other reasons at the same time.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add a WithChainUnaryServerInterceptor server option to allow
using more that one server side interceptor which will then
get chained and invoked in the order given.

This should allow us to implement opentelemetry instrumentation
as interceptors while allowing users to keep intercepting their
server side calls for other reasons at the same time.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub klihub force-pushed the devel/unary-interceptor-chaining branch from db08a00 to 40f227d Compare August 25, 2023 13:07
@klihub klihub requested a review from fuweid August 25, 2023 13:09
@dmcgowan
Copy link
Member

dmcgowan commented Sep 5, 2023

This looks ready to me

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 9c0db2b into containerd:main Sep 6, 2023
11 checks passed
@klihub klihub deleted the devel/unary-interceptor-chaining branch September 6, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants