Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the deprecated NewTracer from OC bridge #4706

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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