-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extract gRPC interceptors from lookout #71
Comments
Could you please elaborate a bit more? Having a wider picture would help a lot. So basically the idea is to move the followings from
right? And also to add some utility functions to get/set
Maybe we could add a separate issue for this. |
Yes, see src-d/lookout#248. Basically, in lookout we add log fields to every log entry, like This was solved in src-d/lookout#359, but that code requires collaboration from the analzyer. The flow of the log-fields is like this: The lookout client will always send the log fields, and the lookout server will always take the log fields if they are present. But the analyzer code needs to get the fields from the incoming gRPC requests (
Yes. As I said, I'm not sure about moving the
I don't mind having 2 PRs for this issue, or to open a new issue for python. But I think it's important to keep both languages on par, if possible. |
I totally agree with Carlos on using |
So if I understood correctly the main concern about bringing here And if we're not using |
I think that in the current state sdk shouldn't provide any solution for logging. Each analyzer can use any library for that. To do logging "right" is a difficult problem especially for a library that will be used by many different applications.
sdk shouldn't log anything (for now). It should just extract log fields from lookout request and send it back when analyzer calls lookout. And maybe provide some simple function that returns |
I'm gonna mimic what has been done in #77 for python. No need to open new issue, this is going to be closed once Go and Python SDK are aligned. |
Moving this to |
Lookout contains two gRPC interceptors in the
grpchelper
package, seeNewServer
andDialContext
in helper.go.The
Ctxlog
interceptor requires that the analyzers also have these interceptors to pass around the log fields like this: lookoutd client -> analyzer server -> analyzer client -> lookoutd server.If we move the
Ctxtlog
interceptor to this repo it probably makes sense to move also theLog
interceptor, to have uniform logs for lookoutd and all the analyzers.I'm not sure about extracting the
util/ctxlog
package to this repo. Maybe we just want to have methods to set and getmap[string]interface{}
in the context, usingcontext.WithValue()
,ctx.Value()
.Ideally the python code should have the same functionality to get the log fields from the gRPC metadata.
The text was updated successfully, but these errors were encountered: