Skip to content

Commit

Permalink
fix(trace): update to opencensus.InstallTraceBridge()
Browse files Browse the repository at this point in the history
  • Loading branch information
liufuyang committed Nov 22, 2023
1 parent 8ff38a3 commit 6d460d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions cloudotel/traceexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
gcppropagator "github.com/GoogleCloudPlatform/opentelemetry-operations-go/propagator"
"go.einride.tech/cloudrunner/cloudruntime"
"go.einride.tech/cloudrunner/cloudzap"
octrace "go.opencensus.io/trace"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/bridge/opencensus"
"go.opentelemetry.io/otel/propagation"
Expand Down Expand Up @@ -61,10 +60,7 @@ func StartTraceExporter(
propagation.TraceContext{},
propagation.Baggage{},
))
// collect and export traces instrumented by open census
tracer := tracerProvider.Tracer("go.einride.tech/cloudrunner.cloudtrace")
//nolint:staticcheck // package is deprecated, replace when possible
octrace.DefaultTracer = opencensus.NewTracer(tracer)
opencensus.InstallTraceBridge()

cleanup := func() {
if err := tracerProvider.ForceFlush(context.Background()); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/soheilhy/cmux v0.1.5
go.einride.tech/protobuf-sensitive v0.5.0
go.opencensus.io v0.24.0
go.opentelemetry.io/contrib/detectors/gcp v1.21.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
go.opentelemetry.io/contrib/instrumentation/host v0.46.1
Expand Down Expand Up @@ -61,6 +60,7 @@ require (
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
Expand Down

0 comments on commit 6d460d1

Please sign in to comment.