Previously, the gRPC method was not included in the tablet query logs
which made debugging an ExecuteBatch vs Execute issue challenging.
To address this, replace the existing RemoteAddr hook with the more
generic CallInfo.Text() result that includes both the remote addr and the
method in the case of gRPC.
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Building off the analogous structure for GRPC, include a callinfo
implementation so that query logs and debug output in vtgate includes
context about the caller.
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Since grpc has a convenient method for getting the peer information
from the context, add the necessary hooks to extract this for the
vitess Callinfo interface so it shows up in query logs and debug
messages.
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
The previous way was internal only and deprecreated.
Therefore, gRPC Go team provided this new Method() function for us.
It is available since gRPC Go 1.11.2: https://github.com/grpc/grpc-go/releases/tag/v1.11.2
(I upgraded the vendored package in a previous commit.)
Signed-off-by: Michael Berlin <mberlin@google.com>
Please refer to #2694 and #2670 for motivation and reasoning for
this change.
I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.
I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.
As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
Upgraded tabletstats to tabletenv. It will contain all tabletserver
environment related vars and types.
* Config is now a global read-only var in tabletenv, which all other
packages can reference.
* LogStats has also moved into tabletenv, because it's used everywhere.
* TabletError has a temporary home there, but it will eventually be
merged into vterrors. Moving there right now causes circular
dependency errors.
* connpool is its own package.
Create a helper-module callinfo for pulling call-related information out
of contexts, an rpcwrap instantiation of this logic, and some rpcwrap
helpers to pull rpcwrap info out of contexts.