connect-go
connect-go copied to clipboard
Support for OpenTelemetry interceptors
Describe the solution you'd like
To support capturing tracing data, it would be amazing to add out-of-the-box support for the OpenTelemetry standard into the connect-go
client/server. This would likely be in the form of an interceptor function that can be optionally added to a server or client instance, similar to what is made available in opentelemetry-go-contrib. That library does provide instrumentation for other well-known packages, so it could be possible to instead add a new instrumentation for connect-go
inside their library.
Describe alternatives you've considered
Within my own playground for connect-go
and connect-web
I have been able to create a custom solution that uses the net/http instrumentation on the server-side, and a custom client-side interceptor to attach some relevant tracing data and the parent traceID to context.
My custom solution does work when using both the grpc-client and connect-go client to make requests, the resulting traces show the parent from the client and the child spans within the server.
With a better defined standard offered either in this library or as an instrumentation in opentelemetry-go-contrib would allow other developers to easily add support for OpenTelemetry with out-of-the-box tracing attributes with their connect-go
server/client instances.
Hey @alehechka - good news! Internally, we're planning to migrate from OpenCensus to OpenTelemetry. We need standardized OTel interceptors for Connect anyways, so we're going to open-source them as a separate module. We're planning to ship these interceptors as part of #343, which we hope to wrap up by early October at the latest.
I'm now actively working on this.
@akshayjshah Hi, are there any more updates for this yet? Thanks.
I'm perpetually pulled into other work 😢 This issue is clearly important, though, so I'm handing it off to @joshcarp to make more rapid progress.
@akshayjshah @joshcarp Hi, are there any more updates for this yet? Thanks.
@nomad-software I previously implemented my own connect interceptor for otel (Unary only, for job, not open source), and have started to work on redoing that and open sourcing it in https://github.com/open-telemetry/opentelemetry-go-contrib.
If @joshcarp is still working on this, he'll probably beat me to the punch as I'm doing it in my own time, but I'll note back here if/when it's released there.
Hey @nomad-software Still WIP and hasn't been abandoned
Thanks @joshcarp for the update. Do you have an ETA for this please? (I'm trying to plan work around it) I think it was pencilled in for the connect v1 release but has slipped since.
hey @nomad-software The bufbuild/connect-opentelemetry-go has been made public although it is unstable (so is opentelemetry I guess). There's still active development on it as it doesn't support streaming handlers/clients for tracing.
@joshcarp That's awesome, thanks a lot! :+1:
We'll be tagging a release of https://github.com/bufbuild/connect-opentelemetry-go in a few days, so I'm going to close this issue. Sorry for the many, many delays everyone!
And, as a final update: https://buf.build/blog/connect-opentelemetry-go/