zipkin-go icon indicating copy to clipboard operation
zipkin-go copied to clipboard

grpc middleware: support to add additional tags to a GRPC ClientHandler

Open fho opened this issue 4 years ago • 4 comments

I would like to add additional fixed tags per GRPC ClientHandler to spans like "component = grpc".

A way to implement it could be to introduce an additional ClientOption to the grpc package to pass tags when calling NewClientHandler(). Similiar to https://github.com/openzipkin/zipkin-go/blob/master/middleware/http/client.go#L60

fho avatar Aug 12 '19 10:08 fho

just to know about existing practice. on the java side we have "parsing callbacks" which allow people to add whatever. doing more generically can prevent whack-a-mole changes later, as we all want the api to be stable as possible.

ex https://github.com/openzipkin/brave/blob/master/instrumentation/grpc/src/main/java/brave/grpc/GrpcClientParser.java

On Mon, Aug 12, 2019 at 6:30 PM José Carlos Chávez [email protected] wrote:

Yes, exactly that. Up for a PR?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-go/issues/143?email_source=notifications&email_token=AAAPVVZNPAYJLGMTSP7Z4JDQEE3TPA5CNFSM4IK7YMDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CEE2A#issuecomment-520372840, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPVVYH7DRNWY6IANYCSC3QEE3TPANCNFSM4IK7YMDA .

codefromthecrypt avatar Aug 12 '19 10:08 codefromthecrypt

also another option. if this is static.. with a span finished handler you can add another tag. ex as long as grpc client adds grpc.method tag you could look for that tag and add your other one. this approach would work for any other tag based on another

On Mon, Aug 12, 2019, 6:32 PM Adrian Cole [email protected] wrote:

just to know about existing practice. on the java side we have "parsing callbacks" which allow people to add whatever. doing more generically can prevent whack-a-mole changes later, as we all want the api to be stable as possible.

ex https://github.com/openzipkin/brave/blob/master/instrumentation/grpc/src/main/java/brave/grpc/GrpcClientParser.java

On Mon, Aug 12, 2019 at 6:30 PM José Carlos Chávez < [email protected]> wrote:

Yes, exactly that. Up for a PR?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin-go/issues/143?email_source=notifications&email_token=AAAPVVZNPAYJLGMTSP7Z4JDQEE3TPA5CNFSM4IK7YMDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CEE2A#issuecomment-520372840, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAPVVYH7DRNWY6IANYCSC3QEE3TPANCNFSM4IK7YMDA .

codefromthecrypt avatar Aug 12 '19 10:08 codefromthecrypt

I am creating an example on this. Hold on for news.

jcchavezs avatar Sep 09 '20 10:09 jcchavezs

@fho FYI https://github.com/openzipkin/zipkin-go/pull/177

jcchavezs avatar Sep 20 '20 19:09 jcchavezs