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

adding stream interceptor for logging middleware #3359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akoserwal
Copy link
Contributor

@akoserwal akoserwal commented Jul 5, 2024

Description (what this PR does / why we need it):

Interceptor can be used as

var opts = []grpc.ServerOption{
		grpc.Middleware(
			recovery.Recovery(),
			logging.Server(logger),
		),
		grpc.StreamInterceptor(logging.StreamServerInterceptor(logger)),
	}

Similarly, for all middleware, an interceptor can be added.

Which issue(s) this PR fixes (resolves / be part of):

fixes #3351

Other special notes for the reviewers:

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 5, 2024
@akoserwal
Copy link
Contributor Author

akoserwal commented Jul 9, 2024

It seems that you can use it directly"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"

Using the above can cause conflict between using kratos middleware for unary and using grpc-middleware for stream server

Does the above apply to all the middlewares: auth, circuit breaker, metadata, metrics, rate limit, recovery, selector, tracing, validate etc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
2 participants