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:
parent
491d65cdaa
commit
27c5c7347b
@ -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.
|
||||
|
@ -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()
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user