-
Notifications
You must be signed in to change notification settings - Fork 707
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
go-grpc-middleware.v2: Action Plan. #275
Comments
As per: #275 ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * Added generic internal interceptor code that both monitoring, logging and tracing will use. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
I have no strong opinion about essentially having a monorepo, but I do wonder what the benefit is. I think they were separate because they had nothing in common not even shared unit test framework or anything. So I wonder if it’s worth it considering that given that things become harder with modules... More generally though I do think these things need a pretty major overhaul and would love to see that happen! :) |
Thanks for the feedback!
Now (as you will see in #276) all middlewares with reuse the majority of its code. Same for test frameworks (: It will be then easier for all maintainers (including Dom, Johan) to understand Prometheus one.
Yes, but in the same time we have to solve it for logrus, zap, go-kit and potentially other implementations (: So far it's quite easy to work with multiple modules, but let's see the pain points (: |
Yeah loggers would all be in the same repo, I'm more thinking things that are more distinct like logging and metrics middleware. But as I said, I'm not against trying this at all. |
Not against you mean (:
…On Mon, 2 Mar 2020 at 09:24, Frederic Branczyk ***@***.***> wrote:
Yeah loggers would all be in the same repo, I'm more thinking things that
are more distinct like logging and metrics middleware. But as I said, I'm
against trying this at all.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#275?email_source=notifications&email_token=ABVA3O7SELUGU3RKVE4CNCDRFN3NZA5CNFSM4K6STMT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENORY3Y#issuecomment-593304687>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVA3O344RE4XJQAMC7SRLLRFN3NZANCNFSM4K6STMTQ>
.
|
As per: #275 The main goals is to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * Added generic internal interceptor code that both monitoring, logging and tracing will use. * Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals is to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * Added generic internal interceptor code that both monitoring, logging and tracing will use. * Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Essentially this is only what all implementations (including Prometheus) will need to implement and test (!):
|
whops, what a great typo.. :D fixed my comment |
As per: #275 The main goals is to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Change: * Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * Added generic internal interceptor code that both monitoring, logging and tracing will use. * Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] Not context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] Changed tags to allow grpc client inside grpc server tags. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. * [x] Let tag.Interceptor to extract request data for all types of requests. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. * [x] Let tag.Interceptor to extract request data for all types of requests. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. * [x] Let tag.Interceptor to extract request data for all types of requests. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. * [x] Let tag.Interceptor to extract request data for all types of requests. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
As per: #275 The main goals are to have separate modules per each implementation and all reusing same code. This way we can ensure consistency, and we reduce LOC to minimum, including tests. ## Changes: * [x] Removed grpc_ prefix from all packages like `grpc_middleware`. User can add them on their own. * [x] Moved all specific implementations to separate modules. Exception is opentracing, as opentracing itself is just amazing interface, so.. perfect (: * [x] Added generic interceptor code that both monitoring, logging and tracing will use under /interceptors * [x] Reuse generic interceptors in interceptor/{logging,tracing,metrics,tags}. This allows huge simplificaiton of those. * [x] No context logger. Only ctxtags.Tags responsible for propagating tags in context and proto messages. * [x] Tags are now map[string]string to discourage context value abuse. * [x] PayloadUnary works as a standalone interceptor as well. * [x] Tags will actually will use map tag instead of noop if not created. * [x] Added scripts for proto generation. * [x] Let tag.Interceptor to extract request data for all types of requests. Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
First to points are done thanks to this: #276 Added few more todos as well. Please propose PRs to v2 if you want to help 🤗 |
TODO suggestion:
|
Definitely a valid request. 👍
…On Mon, 9 Mar 2020 at 12:14, Panshul Gupta ***@***.***> wrote:
TODO suggestion:
grpc_logrus.Decider currently takes fullMethodName string and err error
as parameters, that restricts us in filtering by only two arguments. Would
be nice to get the context in this method, so that we can filter by more
things, such as the IP address of requester.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#275?email_source=notifications&email_token=ABVA3O7D4QBKDSVZI6QBJTTRGTMTZA5CNFSM4K6STMT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOG3XBQ#issuecomment-596491142>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVA3O5ORSFKEALZY4BXQYDRGTMTZANCNFSM4K6STMTQ>
.
|
I'd like to see an interceptor that uses It might be effective to, instead of writing an interceptor for each log library, write one for |
We already did that (:
…On Wed, 18 Mar 2020 at 15:08, Matt Bailey ***@***.***> wrote:
I'd like to see an interceptor that uses grpclog
It might be effective to, instead of writing an interceptor for each log
library, write one for grpclog and then write interface shims for log
libraries to satisfy the grpclog.LoggerV2 interface.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#275 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVA3OZDSE5A5DYFNIFRKH3RIDPYHANCNFSM4K6STMTQ>
.
|
FWIW, I've had luck with multiple modules in a repo, but non-nested and without the v2+ go module "feature". I did suspect that the /v2/ needs to be at the end of the nested modules, but I wasn't 100% sure it wasn't part of Go's Very Well Documented Module Magick. :-| I tried playing around with this in my fork, but it got very complicated. I can also poke at it later today after I get some sleep. |
Fixing modules in this Pr: #296 |
I'd like to help this part.
|
Please help @XSAM (: Also @johanbrandhorst we were having an interesting discussion with @yashrsharma44 For example, all our intercepters are using a solid reporter interface. Such a reporter is not really tied to gRPC which gives us a quick way to implement tripperware and middleware for pure HTTP code as well that ensure the same metric, logging, tracing and tags behavior among HTTP and gRPC. This, however, would mean that:
What do you think? (: |
I think there's a real danger of going to deep on abstractions. Lets keep it simple if we can. |
Yes, especially now there is not much code. This is something to think
about. (: For now we plan to logging into Thanos directly and adjust for
HTTP.
…On Thu, 25 Jun 2020 at 14:26, Johan Brandhorst ***@***.***> wrote:
I think there's a real danger of going to deep on abstractions. Lets keep
it simple if we can.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#275 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVA3O4BD3OJ5NTXEXZYA5TRYM7BDANCNFSM4K6STMTQ>
.
|
Just FYI, I've been using the logging interceptors (zerolog specifically) in prod with zero issues. |
Amazing, looking for more time to finish things up (: protobuf and grpc nearly updated to latest |
I pulled all the tasks to separate issues, so the idea is for @yashrsharma44 to create GH project for first v2 release and track outstanding items there. (: |
@bwplotka I'm glad to see v2 happening! For metrics, have you considered using gRPC's https://github.com/piotrkowalczuk/promgrpc uses p.s. I'm glad that v2 does not have any global state and does not register with the global prometheus registry! |
Where is outstanding working being tracked? I was looking at the list in this issue and noticed some where already done like github-actions. |
Is it time for another release candidate? last was 9 months ago |
@ash2k Is there any difference on using |
@yashrsharma44 I'm not the best person to ask as I'm not a gRPC expert, but off the top of my head:
|
Hi 👋
We have tons of stuff to improve in this library and there wasn't really time for this. Let's do it finally! Let's maintain this issue as a single place to track our work. 💪 cc @domgreen @johanbrandhorst @mwitkow
The plan is to start from scratch in the
v2
branch. We will work in the background until it's done.Work Done
Started v2 branch, implemented all while leaving same API. Assignee: @bwplotka
Never again use those weird
module_names
🙃 Done Assignee: @bwplotkaMulti-module architecture, allowing us to avoid dependency hell, but also retaining mono repo. Module structure: Done Assignee: @bwplotka
The key part is to make sure the core is never importing the provider's code. There has to be indirection. This way the lib has minimum dependencies possible, with core literally having core only.
If maintaining multi modules will be problematic, we can look into modularise cc @Helcaraxan
TODO (help wanted!) for 2.0:
Blockers:
gorelease
(https://godoc.org/golang.org/x/exp/cmd/gorelease)Can be done in 2.x
Any other ideas?
The text was updated successfully, but these errors were encountered: