Skip to content

Commit 87303ca

Browse files
djjuhaszsevein
authored andcommitted
Replace obsolete no-op tracer providers
1 parent 6f92cc2 commit 87303ca

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

internal/batch/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/go-logr/logr"
1111
"go.artefactual.dev/tools/ref"
12-
"go.opentelemetry.io/otel/trace"
12+
"go.opentelemetry.io/otel/trace/noop"
1313
temporalapi_enums "go.temporal.io/api/enums/v1"
1414
temporalapi_serviceerror "go.temporal.io/api/serviceerror"
1515
temporalsdk_client "go.temporal.io/sdk/client"
@@ -142,7 +142,7 @@ func (s *batchImpl) Hints(ctx context.Context) (*goabatch.BatchHintsResult, erro
142142
func (s *batchImpl) InitProcessingWorkflow(ctx context.Context, req *collection.ProcessingWorkflowRequest) error {
143143
req.ValidationConfig = validation.Config{}
144144
// req.MetadataConfig = metadata.Config{}
145-
tr := trace.NewNoopTracerProvider().Tracer("")
145+
tr := noop.NewTracerProvider().Tracer("")
146146
err := collection.InitProcessingWorkflow(ctx, tr, s.cc, s.taskQueue, req)
147147
if err != nil {
148148
s.logger.Error(err, "Error initializing processing workflow.")

internal/collection/goa.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strings"
1414
"time"
1515

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

267267
req.WorkflowID = *goacol.WorkflowID
268268
req.CollectionID = goacol.ID
269-
tr := trace.NewNoopTracerProvider().Tracer("")
269+
tr := noop.NewTracerProvider().Tracer("")
270270
if err := InitProcessingWorkflow(ctx, tr, w.cc, w.taskQueue, req); err != nil {
271271
return fmt.Errorf("error starting the new workflow instance: %w", err)
272272
}

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
sdktrace "go.opentelemetry.io/otel/sdk/trace"
2727
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
2828
"go.opentelemetry.io/otel/trace"
29+
"go.opentelemetry.io/otel/trace/noop"
2930
temporalsdk_activity "go.temporal.io/sdk/activity"
3031
temporalsdk_client "go.temporal.io/sdk/client"
3132
temporalsdk_worker "go.temporal.io/sdk/worker"
@@ -442,7 +443,7 @@ func initTracerProvider(ctx context.Context, logger logr.Logger, cfg TelemetryCo
442443
if !cfg.Traces.Enabled || cfg.Traces.Address == "" {
443444
logger.V(1).Info("Tracing system is disabled.", "enabled", cfg.Traces.Enabled, "addr", cfg.Traces.Address)
444445
shutdown := func(context.Context) error { return nil }
445-
return trace.NewNoopTracerProvider(), shutdown, nil
446+
return noop.NewTracerProvider(), shutdown, nil
446447
}
447448

448449
conn, err := grpc.DialContext(

0 commit comments

Comments
 (0)