google-api-go-client
google-api-go-client copied to clipboard
Remove Opencensus in favor of opentelemetry?
Hello! I was wondering if there's been any effort or if it would be welcome upstream to remove opencensus as a dependency? Opencensus has been merged with opentracing to create opentelemetry, and opencensus will no longer be receiving security updates soon.
OpenCensus and OpenTracing have merged to form OpenTelemetry, which serves as the next major version of OpenCensus and OpenTracing. OpenTelemetry will offer backwards compatibility with existing OpenCensus integrations, and we will continue to make security patches to existing OpenCensus libraries for two years.
If it's welcome, I'd be able to migrate the opentracing usages to otel!
We do plan to support otel in the future, but I don't have a timeline on when this will be. We will need to make sure we don't break existing workflows that might expect opencensus traces etc. Also some of our libraries have needs for metics which is still not supported in the Go client, at least it is not stable.
There is also an issue that our libraries seem to provide more support for older runtimes. So until we support 1.16+ only I don't think we can use the latest versions of otel libraries. I will leave this issue open and post back when I know more.
great, thank you for letting me know!
Honestly, providing a generic way to inject any custom Transport would be nice (in parallel to addOCTransport). You'd then have the choice to use otel or any other solution.
@antoinedeschenes You can kind of due this today with: https://pkg.go.dev/google.golang.org/api/option#WithHTTPClient
@antoinedeschenes You can kind of due this today with: https://pkg.go.dev/google.golang.org/api/option#WithHTTPClient
Yeah, I looked into that, trying to add this through a bigquery.NewService, for example, involves a lot of reimplementation (custom header options, private method calls, internal packages, etc.) used to build the default http client, we quickly go down a rabbit hole.
The repo for opencensus https://github.com/census-instrumentation/opencensus-go says this:
All OpenCensus Github repositories will be archived on July 31st, 2023
It seems the time is come to remove the dependency on opencensus, and use opentelemetry.
Yes, I agree. We have started conversations about how we plan to move away from opencensus in the not too distant future.
Any movement on this?
Trace context propagation support for OpenTelemetry was introduced in v0.154.0 via PR #2127.
The timeline for removing the trace context propagation support for OpenCensus (as well as the OpenCensus tracing support in several of the libraries in the google-cloud-go repo), is discussed here, along with examples of how to pass options to OpenTelemetry trace context propagation:
https://github.com/googleapis/google-cloud-go/blob/main/debug.md#opencensus
awesome, thank you!