From a0a003bc0c82b3269cf16e869306fa0db52745ad Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 10 Nov 2023 12:35:40 -0800 Subject: [PATCH 1/3] Remove the deprecated NewTracer from OC bridge --- CHANGELOG.md | 4 ++++ bridge/opencensus/trace.go | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4e7ad475f5..075c3616028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Removed + +- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#TBD) + ## [1.20.0/0.43.0] 2023-11-10 This release brings a breaking change for custom trace API implementations. Some interfaces (`TracerProvider`, `Tracer`, `Span`) now embed the `go.opentelemetry.io/otel/trace/embedded` types. Implementors need to update their implementations based on what they want the default behavior to be. See the "API Implementations" section of the [trace API] package documentation for more information about how to accomplish this. diff --git a/bridge/opencensus/trace.go b/bridge/opencensus/trace.go index b1df5a3ca6c..92ec6d6961a 100644 --- a/bridge/opencensus/trace.go +++ b/bridge/opencensus/trace.go @@ -23,15 +23,6 @@ import ( "go.opentelemetry.io/otel/trace" ) -// NewTracer returns an implementation of the OpenCensus Tracer interface which -// uses OpenTelemetry APIs. Using this implementation of Tracer "upgrades" -// libraries that use OpenCensus to OpenTelemetry to facilitate a migration. -// -// Deprecated: Use InstallTraceBridge instead. -func NewTracer(tracer trace.Tracer) octrace.Tracer { - return internal.NewTracer(tracer) -} - // InstallTraceBridge installs the OpenCensus trace bridge, which overwrites // the global OpenCensus tracer implementation. Once the bridge is installed, // spans recorded using OpenCensus are redirected to the OpenTelemetry SDK. From 36eaf29e89e337a3a4bf8007b964f59b5a6ca2a4 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 10 Nov 2023 12:37:22 -0800 Subject: [PATCH 2/3] Update PR number in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 075c3616028..05e0d6564a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Removed -- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#TBD) +- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706) ## [1.20.0/0.43.0] 2023-11-10 From 7309f30e091454365aaa3274bc18a2c7ee2b1678 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 10 Nov 2023 12:43:01 -0800 Subject: [PATCH 3/3] Remove example test for NewTracer --- bridge/opencensus/example_test.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bridge/opencensus/example_test.go b/bridge/opencensus/example_test.go index 57fef19e168..3fa3b62179c 100644 --- a/bridge/opencensus/example_test.go +++ b/bridge/opencensus/example_test.go @@ -15,21 +15,10 @@ package opencensus_test import ( - octrace "go.opencensus.io/trace" - - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/bridge/opencensus" "go.opentelemetry.io/otel/sdk/metric" ) -func ExampleNewTracer() { - // Create an OpenTelemetry Tracer to use to record spans. - tracer := otel.GetTracerProvider().Tracer("go.opentelemetry.io/otel/bridge/opencensus") - // Overwrite the OpenCensus DefaultTracer so that it uses OpenTelemetry - // rather than OpenCensus. - octrace.DefaultTracer = opencensus.NewTracer(tracer) -} - func ExampleNewMetricProducer() { // Create the OpenCensus Metric bridge. bridge := opencensus.NewMetricProducer()