-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix trace diffs #667
Fix trace diffs #667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we inject into the tail of the servers/clients in chain
some element to detect that we achieved the tail?
@@ -28,6 +30,10 @@ import ( | |||
// to insure that we never call a method on a nil object | |||
type tailServer struct{} | |||
|
|||
func newWrappedTailServer(wrapper ServerWrapper) networkservice.NetworkServiceServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not modify next to fix this issue.
next
should not know anything about logging.
3b55b5f
to
a570eff
Compare
|
||
func (t *printerClient) Close(ctx context.Context, conn *networkservice.Connection, opts ...grpc.CallOption) (*empty.Empty, error) { | ||
logRequest(ctx, conn) | ||
return next.Client(ctx).Close(ctx, conn, opts...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we do not log response here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because Close(...)
returns protobuf.Empty
. There is nothing for logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but can we try to log changes in conn?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably you are right.
Do you think there might be the next implementation of Close?
func Close(...) {
// some code
r, err := next.Server(ctx).Close(ctx, connection)
// changes inside connection here
return r, err
}
@@ -50,8 +64,6 @@ func (t *traceClient) Request(ctx context.Context, request *networkservice.Netwo | |||
ctx, finish := withLog(ctx, operation) | |||
defer finish() | |||
|
|||
logRequest(ctx, request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need to remember current request before it will be modified with traced.
connInfo.Request = proto.Clone(request)
475b305
to
c2aa8f8
Compare
&traceClient{traced: traced}, | ||
&printerClient{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&traceClient{traced: traced}, | |
&printerClient{}, | |
&beginTraceClient{traced: traced}, | |
&endTraceClient{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks good
Signed-off-by: Artem Glazychev <[email protected]>
c2aa8f8
to
d61177f
Compare
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
…k@master networkservicemesh/sdk#667 networkservicemesh/sdk PR link: networkservicemesh/sdk#667 networkservicemesh/sdk commit message: commit a11ecd1ddce39d9232ca14cf1287a12224b0edbc Author: Artem Glazychev <[email protected]> Date: Wed Feb 3 16:03:22 2021 +0700 Fix trace diffs (#667) Signed-off-by: Artem Glazychev <[email protected]> Signed-off-by: NSMBot <[email protected]>
Fixes: #622
Signed-off-by: Artem Glazychev [email protected]