Skip to content
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

Delete the gRPC example #14

Closed
anuraaga opened this issue Sep 14, 2021 · 9 comments · Fixed by #126
Closed

Delete the gRPC example #14

anuraaga opened this issue Sep 14, 2021 · 9 comments · Fixed by #126

Comments

@anuraaga
Copy link
Contributor

Users should use gRPC library instrumentation and definitely not do manual instrumentation of gRPC. We do get confusion because of the example though.

open-telemetry/opentelemetry-java#3610 (comment)

IIRC, this isn't the first time - I don't think we should have this example since it's not an example of usage we would expect as we have the library instrumentation.

@jkwatson
Copy link
Contributor

Do you have some ideas on what else we could provide for client/server examples? Or, is the http example enough?

@jsuereth
Copy link

Two thoughts:

  1. Where do we have examples for folks writing instrumentation?
  2. For folks who want library-based implementation, is there an example that uses gRPC we can have instead? All the examples in the instrumentation repository push towards the agent (or are for agent extensions)

@trask
Copy link
Member

trask commented Sep 15, 2021

All the examples in the instrumentation repository push towards the agent (or are for agent extensions)

Check out https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/standalone-library-instrumentation.md#standalone-library-instrumentation for library-based instrumentation.

Though only some of those have nice docs so far, e.g.

@jack-berg jack-berg transferred this issue from open-telemetry/opentelemetry-java Jan 10, 2022
@mishra48
Copy link

Im also curious. I have a grpc client and server and i want to instrument it. what example should i follow?

@mishra48
Copy link

@trask appreciate the quick reply but I'm completely new to this so, i'm feeling a bit lost.
Any small examples on how to start this would be greatly appreciated.

@mishra48
Copy link

mishra48 commented Mar 14, 2022

@trask I'm looking to manually instrument my code as i dont want any extra overhead of running the java agent

@trask
Copy link
Member

trask commented Mar 14, 2022

the grpc library instrumentation linked above is not using the javaagent

@dboreham
Copy link

dboreham commented Sep 30, 2022

I'm driving by, after an evening of hair loss trying to figure out why my kotlin grpc server doesn't propagate OT spans. This is probably the 10th bug report I've read, and I've read all the GrpcTracing code and all the related tests. I confess that even though supposedly I know quite a bit about this subject, I may have experienced knowledge and information sucked out of my brain through this process. I feel that I know less than when I started.

The only reference I've been able to find for this is here: https://github.com/pambrose/prometheus-proxy/blob/master/src/main/kotlin/io/prometheus/proxy/ProxyGrpcService.kt#L71 , but it is using a tracing library from Zipkin (brave.grpc.GrpcTracing). My best current plan is to copy what that code does.

One quick question that's front of mind: should I expect agent-based instrumentation of a gRPC (using the stock io.grpc libraries) Kotlin application to "just work", or do I need to arrange to add an interceptor to my gRPC server to do span propagation? I think I read both forks in the multiverse above!

Actually I have an even more basic question: if I have the agent, but also call the library (e.g. use @withSpan), is that expected to work? Or am I creating some split-brain frankentracing machine? I ask because I see many comments along the lines of "Ahh well if you were using the agent...". Ok, what if I'm using both?

For background, I got here after attempting to diagnose a problem in a very large multi-service, multi-language application that uses OT, but I discovered that spans aren't being propagated in various scenarios. I thought this one would be the easiest to fix...

Hope that all made some sense.

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

Successfully merging a pull request may close this issue.

6 participants