From 33ad753302754c102247424b03ec4d1d8b9042c3 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 6 Nov 2024 10:57:01 +0300 Subject: [PATCH] [#1473] policer: Add tracing span To filter HEAD requests from policer. Signed-off-by: Dmitrii Stepanov --- pkg/services/policer/check.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index 401977f66..dbc9ea53c 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -9,14 +9,25 @@ import ( objectcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object" policycore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/policy" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/replicator" + "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) func (p *Policer) processObject(ctx context.Context, objInfo objectcore.Info) error { + ctx, span := tracing.StartSpanFromContext(ctx, "Policer.ProcessObject", trace.WithAttributes( + attribute.String("address", objInfo.Address.String()), + attribute.Bool("is_linking_object", objInfo.IsLinkingObject), + attribute.Bool("is_ec_part", objInfo.ECInfo != nil), + attribute.String("type", objInfo.Type.String()), + )) + defer span.End() + cnr, err := p.cnrSrc.Get(objInfo.Address.Container()) if err != nil { if client.IsErrContainerNotFound(err) {