From 8b78db74bcfbf0117dedd6e898da4f95f0e191e6 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 13 Jul 2023 14:58:15 +0300 Subject: [PATCH] [#463] replicator: Add tracing span Signed-off-by: Dmitrii Stepanov --- pkg/services/replicator/process.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/services/replicator/process.go b/pkg/services/replicator/process.go index a54668e12..16bcec9c5 100644 --- a/pkg/services/replicator/process.go +++ b/pkg/services/replicator/process.go @@ -6,7 +6,10 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine" putsvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object/put" + "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) @@ -28,6 +31,13 @@ func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult) ) }() + ctx, span := tracing.StartSpanFromContext(ctx, "Replicator.HandleTask", + trace.WithAttributes( + attribute.Stringer("address", task.Addr), + attribute.Int64("number_of_copies", int64(task.NumCopies)), + )) + defer span.End() + if task.Obj == nil { var err error task.Obj, err = engine.Get(ctx, p.localStorage, task.Addr)