Skip to content

Commit 263523c

Browse files
authored
fix: composable parallel router tracing by index (#84)
1 parent 77f4db3 commit 263523c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compparallel.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package routinghelpers
33
import (
44
"context"
55
"errors"
6-
"fmt"
76
"reflect"
87
"sync"
98
"sync/atomic"
@@ -387,7 +386,7 @@ func getChannelOrErrorParallel[T any](
387386
blocking.Add(1) // start at one so we don't cancel while dispatching
388387
var sent atomic.Bool
389388

390-
for _, r := range routers {
389+
for i, r := range routers {
391390
ctx, span := tracer.StartSpan(ctx, composeName+".worker")
392391
isBlocking := !isSearchValue || !r.DoNotWaitForSearchValue
393392
if isBlocking {
@@ -398,7 +397,7 @@ func getChannelOrErrorParallel[T any](
398397
span.SetAttributes(
399398
attribute.Bool("blocking", isBlocking),
400399
attribute.Stringer("type", reflect.TypeOf(r.Router)),
401-
attribute.String("string", fmt.Sprint(r.Router)),
400+
attribute.Int("routingNumber", i),
402401
)
403402
}
404403

0 commit comments

Comments
 (0)