Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

[grpc] java-client -> go-server interop test fail #18

Open
HailongWen opened this issue Mar 27, 2018 · 6 comments
Open

[grpc] java-client -> go-server interop test fail #18

HailongWen opened this issue Mar 27, 2018 · 6 comments

Comments

@HailongWen
Copy link
Contributor

The response by go-server does not contain tag "method".

SEVERE: Client received wrong TagContext. Got [Tag{key=TagKey{name=operation}, value=TagValue{asString=interop-test}}, Tag{key=TagKey{name=project}, value=TagValue{asString=open-census}}], want [Tag{key=TagKey{name=method}, value=TagValue{asString=interop.EchoService/echo}}, Tag{key=TagKey{name=operation}, value=TagValue{asString=interop-test}}, Tag{key=TagKey{name=project}, value=TagValue{asString=open-census}}].

With @songy23 's help, I found the behavior change is due to census-instrumentation/opencensus-go#566. Which behavior is correct? Should the "method" be propagated or not? If not, we should probably change the java code.

@songy23
Copy link
Contributor

songy23 commented Mar 27, 2018

FYI the method tag will be automatically propagated in gRPC Java: https://github.com/grpc/grpc-java/blob/master/core/src/main/java/io/grpc/internal/CensusStatsModule.java#L332. While in Go, it's no longer propagated after census-instrumentation/opencensus-go#566.

/cc @dinooliva @sebright @rakyll @Ramonza @bogdandrutu

@songy23
Copy link
Contributor

songy23 commented Mar 27, 2018

@sebright
Copy link
Contributor

I think gRPC should record stats with the method tag but not propagate it, since the server already knows what method was called and can add the tag back.

@semistrict
Copy link
Contributor

We deliberately stopped propagating it because it doesn't really make sense outside the scope of the original request.

@songy23
Copy link
Contributor

songy23 commented Mar 27, 2018

Make sense. I think we need to specify this in gRPC propagation spec (census-instrumentation/opencensus-specs#66) if not propagating method tag is the desired bebavior.

@dinooliva
Copy link
Contributor

The grpc client doesn't need to propagate the method tag but the grpc server does need to add it to the context where the rpc is being processed so there should be a method tag in scope on the server side.

Also, if the grpc server subsequently makes a call as a grpc client, then the method tag will be propagated since it is in scope (I don't believe gRPC has any logic for explicitly removing the method tag).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants