Skip to content

Commit

Permalink
Cleanup: migrate off deprecated trace.NewNoopTracerProvider()
Browse files Browse the repository at this point in the history
This commit migrates off the deprecated trace.NewNoopTracerProvider
func.

part of #7464
  • Loading branch information
JeromeJu committed Dec 6, 2023
1 parent b6d27a8 commit 84b25a0
Show file tree
Hide file tree
Showing 41 changed files with 792 additions and 179 deletions.
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ require (
github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.7.6
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
k8s.io/utils v0.0.0-20230505201702-9f6742963106
)

Expand Down Expand Up @@ -131,9 +131,9 @@ require (
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/zeebo/errs v1.3.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect
)

require (
Expand Down Expand Up @@ -181,7 +181,7 @@ require (
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-kit/log v0.2.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
tracesdk "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
listerv1 "k8s.io/client-go/listers/core/v1"
Expand All @@ -50,7 +51,7 @@ func init() {
func New(service string, logger *zap.SugaredLogger) *tracerProvider {
return &tracerProvider{
service: service,
provider: trace.NewNoopTracerProvider(),
provider: noop.NewTracerProvider(),
logger: logger,
}
}
Expand Down Expand Up @@ -144,7 +145,7 @@ func (t *tracerProvider) reinitialize() {

func createTracerProvider(service string, cfg *config.Tracing, user, pass string) (trace.TracerProvider, error) {
if !cfg.Enabled {
return trace.NewNoopTracerProvider(), nil
return noop.NewTracerProvider(), nil
}

exp, err := jaeger.New(jaeger.WithCollectorEndpoint(
Expand Down
113 changes: 112 additions & 1 deletion vendor/github.com/go-logr/logr/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions vendor/github.com/go-logr/logr/SECURITY.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 84b25a0

Please sign in to comment.