1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-30 21:20:04 +02:00

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 <dashpole@google.com>
This commit is contained in:
Tyler Yahn 2023-11-13 07:27:07 -08:00 committed by GitHub
parent 491d65cdaa
commit 27c5c7347b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 20 deletions

View File

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

View File

@ -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()

View File

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