Skip to content

Commit

Permalink
Remove the deprecated NewTracer from OC bridge (#4706)
Browse files Browse the repository at this point in the history
* Remove the deprecated NewTracer from OC bridge

* Update PR number in changelog

* Remove example test for NewTracer

---------

Co-authored-by: David Ashpole <dashpole@google.com>
  • Loading branch information
MrAlias and dashpole committed Nov 13, 2023
1 parent 491d65c commit 27c5c73
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`. (#4706)

## [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.
Expand Down
11 changes: 0 additions & 11 deletions bridge/opencensus/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 0 additions & 9 deletions bridge/opencensus/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 27c5c73

Please sign in to comment.