From 17411cac009d10e82a380c37c25bb7875cc47079 Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 7 Jul 2026 09:04:51 +0200 Subject: [PATCH 1/5] fix: add client and server span kind --- go.mod | 2 +- go.sum | 4 ++-- pkg/pingpong/pingpong.go | 5 +++-- pkg/pushsync/pushsync.go | 4 ++-- pkg/retrieval/retrieval.go | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index f5bc7086b89..ec34e6dfd43 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/ethereum/go-ethereum v1.17.3 github.com/ethersphere/batch-archive v0.0.8 github.com/ethersphere/go-price-oracle-abi v0.6.9 - github.com/ethersphere/go-storage-incentives-abi v0.9.4 + github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4 github.com/ethersphere/go-sw3-abi v0.6.9 github.com/ethersphere/langos v1.0.0 github.com/go-playground/validator/v10 v10.19.0 diff --git a/go.sum b/go.sum index ae85aa06dc6..1b1b9b950ea 100644 --- a/go.sum +++ b/go.sum @@ -250,8 +250,8 @@ github.com/ethersphere/batch-archive v0.0.8 h1:Y6ipqJfcjLbOn+2Rn5tMrOvrMH7pzF0Yh github.com/ethersphere/batch-archive v0.0.8/go.mod h1:41BPb192NoK9CYjNB8BAE1J2MtiI/5aq0Wtas5O7A7Q= github.com/ethersphere/go-price-oracle-abi v0.6.9 h1:bseen6he3PZv5GHOm+KD6s4awaFmVSD9LFx+HpB6rCU= github.com/ethersphere/go-price-oracle-abi v0.6.9/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk= -github.com/ethersphere/go-storage-incentives-abi v0.9.4 h1:mSIWXQXg5OQmH10QvXMV5w0vbSibFMaRlBL37gPLTM0= -github.com/ethersphere/go-storage-incentives-abi v0.9.4/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= +github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4 h1:YK9FpiQz29ctU5V46CuwMt+4X5Xn8FTBwy6E2v/ix8s= +github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= github.com/ethersphere/go-sw3-abi v0.6.9 h1:TnWLnYkWE5UvC17mQBdUmdkzhPhO8GcqvWy4wvd1QJQ= github.com/ethersphere/go-sw3-abi v0.6.9/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU= github.com/ethersphere/langos v1.0.0 h1:NBtNKzXTTRSue95uOlzPN4py7Aofs0xWPzyj4AI1Vcc= diff --git a/pkg/pingpong/pingpong.go b/pkg/pingpong/pingpong.go index 858ba4d4f39..777d5a30e94 100644 --- a/pkg/pingpong/pingpong.go +++ b/pkg/pingpong/pingpong.go @@ -20,6 +20,7 @@ import ( "github.com/ethersphere/bee/v2/pkg/swarm" "github.com/ethersphere/bee/v2/pkg/tracing" "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" ) // loggerName is the tree path name of the logger for this package. @@ -65,7 +66,7 @@ func (s *Service) Protocol() p2p.ProtocolSpec { } func (s *Service) Ping(ctx context.Context, address swarm.Address, msgs ...string) (rtt time.Duration, err error) { - span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-ping", s.logger) + span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-ping", s.logger, trace.WithSpanKind(trace.SpanKindClient)) span.SetAttributes(attribute.String("peer_address", address.String())) defer span.End() @@ -105,7 +106,7 @@ func (s *Service) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) er w, r := protobuf.NewWriterAndReader(stream) defer stream.FullClose() - span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-handler", s.logger) + span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-handler", s.logger, trace.WithSpanKind(trace.SpanKindServer)) span.SetAttributes(attribute.String("peer_address", p.Address.String())) defer span.End() diff --git a/pkg/pushsync/pushsync.go b/pkg/pushsync/pushsync.go index f11dfd55f9c..951b316cdfd 100644 --- a/pkg/pushsync/pushsync.go +++ b/pkg/pushsync/pushsync.go @@ -207,7 +207,7 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) chunk := swarm.NewChunk(swarm.NewAddress(ch.Address), ch.Data) chunkAddress := chunk.Address() - span, _, ctx := ps.tracer.StartSpanFromContext(ctx, "pushsync-handler", ps.logger, trace.WithAttributes( + span, _, ctx := ps.tracer.StartSpanFromContext(ctx, "pushsync-handler", ps.logger, trace.WithSpanKind(trace.SpanKindServer), trace.WithAttributes( attribute.String("address", chunkAddress.String()), attribute.Int64("tag_id", int64(chunk.TagID())), attribute.String("sender_address", p.Address.String()), @@ -539,7 +539,7 @@ func (ps *PushSync) push(parentCtx context.Context, resultChan chan<- receiptRes now := time.Now() - spanInner, _, _ := ps.tracer.FollowSpanFromContext(context.WithoutCancel(parentCtx), "push-chunk-async", ps.logger, trace.WithAttributes( + spanInner, _, _ := ps.tracer.FollowSpanFromContext(context.WithoutCancel(parentCtx), "push-chunk-async", ps.logger, trace.WithSpanKind(trace.SpanKindClient), trace.WithAttributes( attribute.String("address", ch.Address().String()), )) diff --git a/pkg/retrieval/retrieval.go b/pkg/retrieval/retrieval.go index f4bc9844a33..21f8b6132aa 100644 --- a/pkg/retrieval/retrieval.go +++ b/pkg/retrieval/retrieval.go @@ -258,7 +258,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s inflight++ go func() { - span, _, ctx := s.tracer.FollowSpanFromContext(spanCtx, "retrieve-chunk", s.logger, trace.WithAttributes( + span, _, ctx := s.tracer.FollowSpanFromContext(spanCtx, "retrieve-chunk", s.logger, trace.WithSpanKind(trace.SpanKindClient), trace.WithAttributes( attribute.String("address", chunkAddr.String()), )) defer span.End() @@ -450,7 +450,7 @@ func (s *Service) handler(p2pctx context.Context, p p2p.Peer, stream p2p.Stream) var forwarded bool - span, _, ctx := s.tracer.StartSpanFromContext(ctx, "handle-retrieve-chunk", s.logger, trace.WithAttributes( + span, _, ctx := s.tracer.StartSpanFromContext(ctx, "handle-retrieve-chunk", s.logger, trace.WithSpanKind(trace.SpanKindServer), trace.WithAttributes( attribute.String("address", addr.String()), )) defer func() { From fde3f9772c2d15255be34c412fa29cf9636afbc7 Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 7 Jul 2026 09:44:16 +0200 Subject: [PATCH 2/5] chore: reorder deps --- go.mod | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index ec34e6dfd43..1a70319b944 100644 --- a/go.mod +++ b/go.mod @@ -64,18 +64,6 @@ require ( resenje.org/web v0.4.3 ) -require ( - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/go-logr/logr v1.4.3 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel/metric v1.43.0 // indirect - go.opentelemetry.io/proto/otlp v1.10.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260504160031-60b97b32f348 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260504160031-60b97b32f348 // indirect -) - require ( filippo.io/bigmod v0.1.1-0.20260103110540-f8a47775ebe5 // indirect filippo.io/keygen v0.0.0-20260114151900-8e2790ea4c5b // indirect @@ -88,6 +76,7 @@ require ( github.com/bits-and-blooms/bitset v1.20.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/caddyserver/zerossl v0.1.3 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/consensys/gnark-crypto v0.18.1 // indirect github.com/crate-crypto/go-eth-kzg v1.5.0 // indirect @@ -103,12 +92,15 @@ require ( github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v1.0.0 // indirect github.com/google/pprof v0.0.0-20250607225305-033d6d78b36a // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/holiman/uint256 v1.3.2 // indirect @@ -188,6 +180,9 @@ require ( github.com/wlynxg/anet v0.0.5 // indirect github.com/zeebo/blake3 v0.2.4 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel/metric v1.43.0 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect go.uber.org/dig v1.19.0 // indirect go.uber.org/fx v1.24.0 // indirect go.uber.org/mock v0.5.2 // indirect @@ -198,6 +193,8 @@ require ( golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 // indirect golang.org/x/text v0.35.0 // indirect golang.org/x/tools v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260504160031-60b97b32f348 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260504160031-60b97b32f348 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect From 71c39202ae2d700327e088204abe43eb2cd48a38 Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 7 Jul 2026 10:30:16 +0200 Subject: [PATCH 3/5] refactor(tracing): namespace span attributes under swarm.* --- pkg/api/bytes.go | 14 +++++++------- pkg/api/bzz.go | 16 ++++++++-------- pkg/api/dirs.go | 6 +++--- pkg/pingpong/pingpong.go | 4 ++-- pkg/pusher/pusher.go | 2 +- pkg/pushsync/pushsync.go | 18 +++++++++--------- pkg/retrieval/retrieval.go | 10 +++++----- pkg/storer/netstore.go | 6 +++--- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pkg/api/bytes.go b/pkg/api/bytes.go index c8e0b318037..1ecbd3e2f7a 100644 --- a/pkg/api/bytes.go +++ b/pkg/api/bytes.go @@ -70,10 +70,10 @@ func (s *Service) bytesUploadHandler(w http.ResponseWriter, r *http.Request) { default: jsonhttp.InternalServerError(w, "cannot get or create tag") } - tracing.RecordError(span, err, attribute.String("action", "tag.create")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "tag.create")) return } - span.SetAttributes(attribute.Int64("tag_id", int64(tag))) + span.SetAttributes(attribute.Int64("swarm.tag.id", int64(tag))) } defer s.observeUploadSpeed(w, r, time.Now(), "bytes", deferred) @@ -97,7 +97,7 @@ func (s *Service) bytesUploadHandler(w http.ResponseWriter, r *http.Request) { default: jsonhttp.BadRequest(w, nil) } - tracing.RecordError(span, err, attribute.String("action", "new.StamperPutter")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "new.StamperPutter")) return } @@ -118,7 +118,7 @@ func (s *Service) bytesUploadHandler(w http.ResponseWriter, r *http.Request) { default: jsonhttp.InternalServerError(ow, "split write all failed") } - tracing.RecordError(span, err, attribute.String("action", "split.WriteAll")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "split.WriteAll")) return } @@ -142,14 +142,14 @@ func (s *Service) bytesUploadHandler(w http.ResponseWriter, r *http.Request) { return } } - span.SetAttributes(attribute.String("root_address", encryptedReference.String())) + span.SetAttributes(attribute.String("swarm.chunk.root_address", encryptedReference.String())) err = putter.Done(reference) if err != nil { logger.Debug("done split failed", "error", err) logger.Error(nil, "done split failed") jsonhttp.InternalServerError(ow, "done split failed") - tracing.RecordError(span, err, attribute.String("action", "putter.Done")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "putter.Done")) return } @@ -157,7 +157,7 @@ func (s *Service) bytesUploadHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set(SwarmTagHeader, fmt.Sprint(tag)) } - span.SetAttributes(attribute.Bool("success", true)) + span.SetAttributes(attribute.Bool("swarm.operation.success", true)) w.Header().Set(AccessControlExposeHeaders, SwarmTagHeader) if headers.Act { diff --git a/pkg/api/bzz.go b/pkg/api/bzz.go index 141b3b55d24..2df221938fa 100644 --- a/pkg/api/bzz.go +++ b/pkg/api/bzz.go @@ -104,10 +104,10 @@ func (s *Service) bzzUploadHandler(w http.ResponseWriter, r *http.Request) { default: jsonhttp.InternalServerError(w, "cannot get or create tag") } - tracing.RecordError(span, err, attribute.String("action", "tag.create")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "tag.create")) return } - span.SetAttributes(attribute.Int64("tag_id", int64(tag))) + span.SetAttributes(attribute.Int64("swarm.tag.id", int64(tag))) } putter, err := s.newStamperPutter(ctx, putterOptions{ @@ -129,7 +129,7 @@ func (s *Service) bzzUploadHandler(w http.ResponseWriter, r *http.Request) { default: jsonhttp.BadRequest(w, nil) } - tracing.RecordError(span, err, attribute.String("action", "new.StamperPutter")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "new.StamperPutter")) return } @@ -221,7 +221,7 @@ func (s *Service) fileUploadHandler( default: jsonhttp.InternalServerError(w, errFileStore) } - tracing.RecordError(span, err, attribute.String("action", "file.store")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "file.store")) return } @@ -330,17 +330,17 @@ func (s *Service) fileUploadHandler( logger.Debug("done split failed", "reference", manifestReference, "error", err) logger.Error(nil, "done split failed") jsonhttp.InternalServerError(w, "done split failed") - tracing.RecordError(span, err, attribute.String("action", "putter.Done")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "putter.Done")) return } span.SetAttributes( - attribute.Bool("success", true), - attribute.String("root_address", reference.String()), + attribute.Bool("swarm.operation.success", true), + attribute.String("swarm.chunk.root_address", reference.String()), ) if tagID != 0 { w.Header().Set(SwarmTagHeader, fmt.Sprint(tagID)) - span.SetAttributes(attribute.Int64("tag_id", int64(tagID))) + span.SetAttributes(attribute.Int64("swarm.tag.id", int64(tagID))) } w.Header().Set(ETagHeader, fmt.Sprintf("%q", reference.String())) w.Header().Set(AccessControlExposeHeaders, SwarmTagHeader) diff --git a/pkg/api/dirs.go b/pkg/api/dirs.go index 49659a3a419..31d5bddb942 100644 --- a/pkg/api/dirs.go +++ b/pkg/api/dirs.go @@ -95,7 +95,7 @@ func (s *Service) dirUploadHandler( default: jsonhttp.InternalServerError(w, errDirectoryStore) } - tracing.RecordError(span, err, attribute.String("action", "dir.store")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "dir.store")) return } @@ -125,13 +125,13 @@ func (s *Service) dirUploadHandler( logger.Debug("store dir failed", "error", err) logger.Error(nil, "store dir failed") jsonhttp.InternalServerError(w, errDirectoryStore) - tracing.RecordError(span, err, attribute.String("action", "putter.Done")) + tracing.RecordError(span, err, attribute.String("swarm.operation.action", "putter.Done")) return } if tag != 0 { w.Header().Set(SwarmTagHeader, fmt.Sprint(tag)) - span.SetAttributes(attribute.Bool("success", true)) + span.SetAttributes(attribute.Bool("swarm.operation.success", true)) } w.Header().Set(AccessControlExposeHeaders, SwarmTagHeader) if act { diff --git a/pkg/pingpong/pingpong.go b/pkg/pingpong/pingpong.go index 777d5a30e94..2ff9b8361bb 100644 --- a/pkg/pingpong/pingpong.go +++ b/pkg/pingpong/pingpong.go @@ -67,7 +67,7 @@ func (s *Service) Protocol() p2p.ProtocolSpec { func (s *Service) Ping(ctx context.Context, address swarm.Address, msgs ...string) (rtt time.Duration, err error) { span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-ping", s.logger, trace.WithSpanKind(trace.SpanKindClient)) - span.SetAttributes(attribute.String("peer_address", address.String())) + span.SetAttributes(attribute.String("swarm.peer.address", address.String())) defer span.End() start := time.Now() @@ -107,7 +107,7 @@ func (s *Service) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) er defer stream.FullClose() span, _, ctx := s.tracer.StartSpanFromContext(ctx, "pingpong-p2p-handler", s.logger, trace.WithSpanKind(trace.SpanKindServer)) - span.SetAttributes(attribute.String("peer_address", p.Address.String())) + span.SetAttributes(attribute.String("swarm.peer.address", p.Address.String())) defer span.End() var ping pb.Ping diff --git a/pkg/pusher/pusher.go b/pkg/pusher/pusher.go index b756bb088d6..3e87c524952 100644 --- a/pkg/pusher/pusher.go +++ b/pkg/pusher/pusher.go @@ -171,7 +171,7 @@ func (s *Service) chunksWorker(startupStabilizer stabilization.Subscriber) { s.metrics.ErrorTime.Observe(time.Since(startTime).Seconds()) tracing.RecordError(op.Span, err) } else { - op.Span.SetAttributes(attribute.Bool("success", true)) + op.Span.SetAttributes(attribute.Bool("swarm.operation.success", true)) } s.metrics.SyncTime.Observe(time.Since(startTime).Seconds()) diff --git a/pkg/pushsync/pushsync.go b/pkg/pushsync/pushsync.go index 951b316cdfd..9e6c57bd645 100644 --- a/pkg/pushsync/pushsync.go +++ b/pkg/pushsync/pushsync.go @@ -208,9 +208,9 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) chunkAddress := chunk.Address() span, _, ctx := ps.tracer.StartSpanFromContext(ctx, "pushsync-handler", ps.logger, trace.WithSpanKind(trace.SpanKindServer), trace.WithAttributes( - attribute.String("address", chunkAddress.String()), - attribute.Int64("tag_id", int64(chunk.TagID())), - attribute.String("sender_address", p.Address.String()), + attribute.String("swarm.chunk.address", chunkAddress.String()), + attribute.Int64("swarm.tag.id", int64(chunk.TagID())), + attribute.String("swarm.peer.sender_address", p.Address.String()), )) var ( @@ -222,11 +222,11 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) if err != nil { tracing.RecordError(span, err) } else { - attrs := []attribute.KeyValue{attribute.Bool("success", true)} + attrs := []attribute.KeyValue{attribute.Bool("swarm.operation.success", true)} if stored { attrs = append(attrs, - attribute.Bool("stored", true), - attribute.String("reason", reason), + attribute.Bool("swarm.chunk.stored", true), + attribute.String("swarm.chunk.store_reason", reason), ) } span.SetAttributes(attrs...) @@ -540,14 +540,14 @@ func (ps *PushSync) push(parentCtx context.Context, resultChan chan<- receiptRes now := time.Now() spanInner, _, _ := ps.tracer.FollowSpanFromContext(context.WithoutCancel(parentCtx), "push-chunk-async", ps.logger, trace.WithSpanKind(trace.SpanKindClient), trace.WithAttributes( - attribute.String("address", ch.Address().String()), + attribute.String("swarm.chunk.address", ch.Address().String()), )) defer func() { if err != nil { tracing.RecordError(spanInner, err) } else { - spanInner.SetAttributes(attribute.Bool("success", true)) + spanInner.SetAttributes(attribute.Bool("swarm.operation.success", true)) } spanInner.End() select { @@ -558,7 +558,7 @@ func (ps *PushSync) push(parentCtx context.Context, resultChan chan<- receiptRes defer action.Cleanup() - spanInner.SetAttributes(attribute.String("peer_address", peer.String())) + spanInner.SetAttributes(attribute.String("swarm.peer.address", peer.String())) receipt, err = ps.pushChunkToPeer(tracing.WithContext(ctx, spanInner.SpanContext()), peer, ch) if err != nil { diff --git a/pkg/retrieval/retrieval.go b/pkg/retrieval/retrieval.go index 21f8b6132aa..1de3f00ba78 100644 --- a/pkg/retrieval/retrieval.go +++ b/pkg/retrieval/retrieval.go @@ -259,7 +259,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s go func() { span, _, ctx := s.tracer.FollowSpanFromContext(spanCtx, "retrieve-chunk", s.logger, trace.WithSpanKind(trace.SpanKindClient), trace.WithAttributes( - attribute.String("address", chunkAddr.String()), + attribute.String("swarm.chunk.address", chunkAddr.String()), )) defer span.End() s.retrieveChunk(ctx, quit, chunkAddr, peer, resultC, action, span) @@ -309,7 +309,7 @@ func (s *Service) retrieveChunk(ctx context.Context, quit chan struct{}, chunkAd tracing.RecordError(span, err) s.metrics.TotalErrors.Inc() } else { - span.SetAttributes(attribute.Bool("success", true)) + span.SetAttributes(attribute.Bool("swarm.operation.success", true)) } select { case result <- retrievalResult{err: err, chunk: chunk, peer: peer}: @@ -451,15 +451,15 @@ func (s *Service) handler(p2pctx context.Context, p p2p.Peer, stream p2p.Stream) var forwarded bool span, _, ctx := s.tracer.StartSpanFromContext(ctx, "handle-retrieve-chunk", s.logger, trace.WithSpanKind(trace.SpanKindServer), trace.WithAttributes( - attribute.String("address", addr.String()), + attribute.String("swarm.chunk.address", addr.String()), )) defer func() { if err != nil { tracing.RecordError(span, err) } else { - span.SetAttributes(attribute.Bool("success", true)) + span.SetAttributes(attribute.Bool("swarm.operation.success", true)) } - span.SetAttributes(attribute.Bool("forwarded", forwarded)) + span.SetAttributes(attribute.Bool("swarm.chunk.forwarded", forwarded)) span.End() }() diff --git a/pkg/storer/netstore.go b/pkg/storer/netstore.go index f9e43ae59c4..059003be12d 100644 --- a/pkg/storer/netstore.go +++ b/pkg/storer/netstore.go @@ -32,7 +32,7 @@ func (db *DB) DirectUpload() PutterSession { defer func() { <-db.directUploadLimiter }() span, logger, ctx := db.tracer.FollowSpanFromContext(ctx, "put-direct-upload", db.logger) - span.SetAttributes(attribute.String("address", ch.Address().String())) + span.SetAttributes(attribute.String("swarm.chunk.address", ch.Address().String())) defer func() { if err != nil { tracing.RecordError(span, err) @@ -84,12 +84,12 @@ func (db *DB) Download(cache bool) storage.Getter { return getterWithMetrics{ storage.GetterFunc(func(ctx context.Context, address swarm.Address) (ch swarm.Chunk, err error) { span, logger, ctx := db.tracer.StartSpanFromContext(ctx, "get-chunk", db.logger) - span.SetAttributes(attribute.String("address", address.String())) + span.SetAttributes(attribute.String("swarm.chunk.address", address.String())) defer func() { if err != nil { tracing.RecordError(span, err) } else { - span.SetAttributes(attribute.Bool("success", true)) + span.SetAttributes(attribute.Bool("swarm.operation.success", true)) } span.End() }() From 1361a8a944a74768960c1b840e42ef11098debaf Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 7 Jul 2026 10:39:51 +0200 Subject: [PATCH 4/5] chore: revert back abi version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1a70319b944..373a6d7a883 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/ethereum/go-ethereum v1.17.3 github.com/ethersphere/batch-archive v0.0.8 github.com/ethersphere/go-price-oracle-abi v0.6.9 - github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4 + github.com/ethersphere/go-storage-incentives-abi v0.9.4 github.com/ethersphere/go-sw3-abi v0.6.9 github.com/ethersphere/langos v1.0.0 github.com/go-playground/validator/v10 v10.19.0 diff --git a/go.sum b/go.sum index 1b1b9b950ea..ae85aa06dc6 100644 --- a/go.sum +++ b/go.sum @@ -250,8 +250,8 @@ github.com/ethersphere/batch-archive v0.0.8 h1:Y6ipqJfcjLbOn+2Rn5tMrOvrMH7pzF0Yh github.com/ethersphere/batch-archive v0.0.8/go.mod h1:41BPb192NoK9CYjNB8BAE1J2MtiI/5aq0Wtas5O7A7Q= github.com/ethersphere/go-price-oracle-abi v0.6.9 h1:bseen6he3PZv5GHOm+KD6s4awaFmVSD9LFx+HpB6rCU= github.com/ethersphere/go-price-oracle-abi v0.6.9/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk= -github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4 h1:YK9FpiQz29ctU5V46CuwMt+4X5Xn8FTBwy6E2v/ix8s= -github.com/ethersphere/go-storage-incentives-abi v0.9.3-rc4/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= +github.com/ethersphere/go-storage-incentives-abi v0.9.4 h1:mSIWXQXg5OQmH10QvXMV5w0vbSibFMaRlBL37gPLTM0= +github.com/ethersphere/go-storage-incentives-abi v0.9.4/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= github.com/ethersphere/go-sw3-abi v0.6.9 h1:TnWLnYkWE5UvC17mQBdUmdkzhPhO8GcqvWy4wvd1QJQ= github.com/ethersphere/go-sw3-abi v0.6.9/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU= github.com/ethersphere/langos v1.0.0 h1:NBtNKzXTTRSue95uOlzPN4py7Aofs0xWPzyj4AI1Vcc= From b8a31791bcf8ea5f34b215adcace0e160506de2d Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Thu, 9 Jul 2026 13:49:29 +0200 Subject: [PATCH 5/5] refactor(tracing): use role-agnostic swarm.peer.address on both span sides --- pkg/pushsync/pushsync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pushsync/pushsync.go b/pkg/pushsync/pushsync.go index 9e6c57bd645..1dc92e9b31e 100644 --- a/pkg/pushsync/pushsync.go +++ b/pkg/pushsync/pushsync.go @@ -210,7 +210,7 @@ func (ps *PushSync) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) span, _, ctx := ps.tracer.StartSpanFromContext(ctx, "pushsync-handler", ps.logger, trace.WithSpanKind(trace.SpanKindServer), trace.WithAttributes( attribute.String("swarm.chunk.address", chunkAddress.String()), attribute.Int64("swarm.tag.id", int64(chunk.TagID())), - attribute.String("swarm.peer.sender_address", p.Address.String()), + attribute.String("swarm.peer.address", p.Address.String()), )) var (