Skip to content

Commit

Permalink
Replace obsolete no-op tracer providers
Browse files Browse the repository at this point in the history
  • Loading branch information
djjuhasz authored and sevein committed Mar 12, 2024
1 parent 6f92cc2 commit 87303ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/batch/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/go-logr/logr"
"go.artefactual.dev/tools/ref"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
temporalapi_enums "go.temporal.io/api/enums/v1"
temporalapi_serviceerror "go.temporal.io/api/serviceerror"
temporalsdk_client "go.temporal.io/sdk/client"
Expand Down Expand Up @@ -142,7 +142,7 @@ func (s *batchImpl) Hints(ctx context.Context) (*goabatch.BatchHintsResult, erro
func (s *batchImpl) InitProcessingWorkflow(ctx context.Context, req *collection.ProcessingWorkflowRequest) error {
req.ValidationConfig = validation.Config{}
// req.MetadataConfig = metadata.Config{}
tr := trace.NewNoopTracerProvider().Tracer("")
tr := noop.NewTracerProvider().Tracer("")
err := collection.InitProcessingWorkflow(ctx, tr, s.cc, s.taskQueue, req)
if err != nil {
s.logger.Error(err, "Error initializing processing workflow.")
Expand Down
4 changes: 2 additions & 2 deletions internal/collection/goa.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"time"

"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
temporalapi_common "go.temporal.io/api/common/v1"
temporalapi_enums "go.temporal.io/api/enums/v1"
temporalapi_serviceerror "go.temporal.io/api/serviceerror"
Expand Down Expand Up @@ -266,7 +266,7 @@ func (w *goaWrapper) Retry(ctx context.Context, payload *goacollection.RetryPayl

req.WorkflowID = *goacol.WorkflowID
req.CollectionID = goacol.ID
tr := trace.NewNoopTracerProvider().Tracer("")
tr := noop.NewTracerProvider().Tracer("")
if err := InitProcessingWorkflow(ctx, tr, w.cc, w.taskQueue, req); err != nil {
return fmt.Errorf("error starting the new workflow instance: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
temporalsdk_activity "go.temporal.io/sdk/activity"
temporalsdk_client "go.temporal.io/sdk/client"
temporalsdk_worker "go.temporal.io/sdk/worker"
Expand Down Expand Up @@ -442,7 +443,7 @@ func initTracerProvider(ctx context.Context, logger logr.Logger, cfg TelemetryCo
if !cfg.Traces.Enabled || cfg.Traces.Address == "" {
logger.V(1).Info("Tracing system is disabled.", "enabled", cfg.Traces.Enabled, "addr", cfg.Traces.Address)
shutdown := func(context.Context) error { return nil }
return trace.NewNoopTracerProvider(), shutdown, nil
return noop.NewTracerProvider(), shutdown, nil
}

conn, err := grpc.DialContext(
Expand Down

0 comments on commit 87303ca

Please sign in to comment.