Skip to content

Commit 785f990

Browse files
committed
Move propagators
1 parent b790847 commit 785f990

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

backend/redis/signal.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/cschleiden/go-workflows/backend"
88
"github.com/cschleiden/go-workflows/backend/history"
99
"github.com/cschleiden/go-workflows/internal/log"
10-
"github.com/cschleiden/go-workflows/internal/tracing"
10+
"github.com/cschleiden/go-workflows/internal/propagators"
1111
"github.com/cschleiden/go-workflows/workflow"
1212
"github.com/redis/go-redis/v9"
1313
"go.opentelemetry.io/otel/attribute"
@@ -30,7 +30,8 @@ func (rb *redisBackend) SignalWorkflow(ctx context.Context, instanceID string, e
3030
return err
3131
}
3232

33-
ctx, err = (&tracing.TracingContextPropagator{}).Extract(ctx, instanceState.Metadata)
33+
// TODO: Can we do this in the client?
34+
ctx, err = (&propagators.TracingContextPropagator{}).Extract(ctx, instanceState.Metadata)
3435
if err != nil {
3536
rb.Options().Logger.Error("extracting tracing context", log.ErrorKey, err)
3637
}

backend/redis/workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/cschleiden/go-workflows/backend/history"
1212
"github.com/cschleiden/go-workflows/core"
1313
"github.com/cschleiden/go-workflows/internal/log"
14-
"github.com/cschleiden/go-workflows/internal/tracing"
14+
"github.com/cschleiden/go-workflows/internal/propagators"
1515
"github.com/cschleiden/go-workflows/internal/workflowerrors"
1616
"github.com/cschleiden/go-workflows/workflow"
1717
"github.com/redis/go-redis/v9"
@@ -301,7 +301,7 @@ func (rb *redisBackend) CompleteWorkflowTask(
301301

302302
if state == core.WorkflowInstanceStateFinished || state == core.WorkflowInstanceStateContinuedAsNew {
303303
// Trace workflow completion
304-
ctx, err = (&tracing.TracingContextPropagator{}).Extract(ctx, task.Metadata)
304+
ctx, err = (&propagators.TracingContextPropagator{}).Extract(ctx, task.Metadata)
305305
if err != nil {
306306
rb.options.Logger.Error("extracting tracing context", log.ErrorKey, err)
307307
}

internal/tracing/tracing.go renamed to internal/propagators/tracing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tracing
1+
package propagators
22

33
import (
44
"context"

0 commit comments

Comments
 (0)