Skip to content

Commit 25e4aff

Browse files
committed
feat: add more attributes to traces
1 parent e8189b5 commit 25e4aff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routing.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,12 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key multihash
547547
if psTryAdd(p) {
548548
select {
549549
case peerOut <- p:
550+
// Add tracing event for finding a provider
550551
span.AddEvent("found provider", trace.WithAttributes(
551552
attribute.Stringer("peer", p.ID),
552553
attribute.Stringer("from", dht.self),
554+
attribute.Int("provider_addrs_count", len(p.Addrs)),
555+
attribute.Bool("found_in_provider_store", true),
553556
))
554557
case <-ctx.Done():
555558
return
@@ -590,6 +593,7 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key multihash
590593
span.AddEvent("found provider", trace.WithAttributes(
591594
attribute.Stringer("peer", prov.ID),
592595
attribute.Stringer("from", p),
596+
attribute.Int("provider_addrs_count", len(prov.Addrs)),
593597
))
594598
case <-ctx.Done():
595599
logger.Debug("context timed out sending more providers")

0 commit comments

Comments
 (0)