From 25e4aff78feaf7a83c0ebde80b538521210292b6 Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:33:40 +0100 Subject: [PATCH] feat: add more attributes to traces --- routing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routing.go b/routing.go index 1df05e1b..1c8280fc 100644 --- a/routing.go +++ b/routing.go @@ -547,9 +547,12 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key multihash if psTryAdd(p) { select { case peerOut <- p: + // Add tracing event for finding a provider span.AddEvent("found provider", trace.WithAttributes( attribute.Stringer("peer", p.ID), attribute.Stringer("from", dht.self), + attribute.Int("provider_addrs_count", len(p.Addrs)), + attribute.Bool("found_in_provider_store", true), )) case <-ctx.Done(): return @@ -590,6 +593,7 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key multihash span.AddEvent("found provider", trace.WithAttributes( attribute.Stringer("peer", prov.ID), attribute.Stringer("from", p), + attribute.Int("provider_addrs_count", len(prov.Addrs)), )) case <-ctx.Done(): logger.Debug("context timed out sending more providers")