google-api-go-client icon indicating copy to clipboard operation
google-api-go-client copied to clipboard

Remove Opencensus in favor of opentelemetry?

Open jaronoff97 opened this issue 3 years ago • 5 comments

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!

jaronoff97 avatar Mar 29 '22 15:03 jaronoff97

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.

codyoss avatar Mar 29 '22 16:03 codyoss

great, thank you for letting me know!

jaronoff97 avatar Mar 30 '22 18:03 jaronoff97

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 avatar Jul 07 '22 13:07 antoinedeschenes

@antoinedeschenes You can kind of due this today with: https://pkg.go.dev/google.golang.org/api/option#WithHTTPClient

codyoss avatar Jul 07 '22 14:07 codyoss

@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.

antoinedeschenes avatar Jul 07 '22 16:07 antoinedeschenes

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.

alexander-hirth avatar Jun 14 '23 11:06 alexander-hirth

Yes, I agree. We have started conversations about how we plan to move away from opencensus in the not too distant future.

codyoss avatar Jun 15 '23 14:06 codyoss

Any movement on this?

tmc avatar Aug 24 '23 02:08 tmc

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

quartzmo avatar Jan 11 '24 21:01 quartzmo

awesome, thank you!

jaronoff97 avatar Jan 11 '24 21:01 jaronoff97