Skip to content

Commit 27c5c73

Browse files
MrAliasdashpole
andauthored
Remove the deprecated NewTracer from OC bridge (#4706)
* Remove the deprecated NewTracer from OC bridge * Update PR number in changelog * Remove example test for NewTracer --------- Co-authored-by: David Ashpole <[email protected]>
1 parent 491d65c commit 27c5c73

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
## [Unreleased]
1010

11+
### Removed
12+
13+
- Remove the deprecated `go.opentelemetry.io/otel/bridge/opencensus.NewTracer`. (#4706)
14+
1115
## [1.20.0/0.43.0] 2023-11-10
1216

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

bridge/opencensus/example_test.go

-11
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,10 @@
1515
package opencensus_test
1616

1717
import (
18-
octrace "go.opencensus.io/trace"
19-
20-
"go.opentelemetry.io/otel"
2118
"go.opentelemetry.io/otel/bridge/opencensus"
2219
"go.opentelemetry.io/otel/sdk/metric"
2320
)
2421

25-
func ExampleNewTracer() {
26-
// Create an OpenTelemetry Tracer to use to record spans.
27-
tracer := otel.GetTracerProvider().Tracer("go.opentelemetry.io/otel/bridge/opencensus")
28-
// Overwrite the OpenCensus DefaultTracer so that it uses OpenTelemetry
29-
// rather than OpenCensus.
30-
octrace.DefaultTracer = opencensus.NewTracer(tracer)
31-
}
32-
3322
func ExampleNewMetricProducer() {
3423
// Create the OpenCensus Metric bridge.
3524
bridge := opencensus.NewMetricProducer()

bridge/opencensus/trace.go

-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ import (
2323
"go.opentelemetry.io/otel/trace"
2424
)
2525

26-
// NewTracer returns an implementation of the OpenCensus Tracer interface which
27-
// uses OpenTelemetry APIs. Using this implementation of Tracer "upgrades"
28-
// libraries that use OpenCensus to OpenTelemetry to facilitate a migration.
29-
//
30-
// Deprecated: Use InstallTraceBridge instead.
31-
func NewTracer(tracer trace.Tracer) octrace.Tracer {
32-
return internal.NewTracer(tracer)
33-
}
34-
3526
// InstallTraceBridge installs the OpenCensus trace bridge, which overwrites
3627
// the global OpenCensus tracer implementation. Once the bridge is installed,
3728
// spans recorded using OpenCensus are redirected to the OpenTelemetry SDK.

0 commit comments

Comments
 (0)