From f5888226645d8621de53693bcf660bee4feeed91 Mon Sep 17 00:00:00 2001 From: Vladislav Veselskiy Date: Mon, 4 Mar 2024 16:11:12 +0300 Subject: [PATCH] Add span attribute owner.id for func SaveMetaRootStruct. --- save.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/save.go b/save.go index d9fdff5..77206fc 100644 --- a/save.go +++ b/save.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" semconv "go.opentelemetry.io/otel/semconv/v1.12.0" + "go.opentelemetry.io/otel/trace" ) const tracerName = "git.bit5.ru/backend/dbmeta" @@ -114,7 +115,11 @@ func SaveMetaRootStruct( deltaSave bool, ) error { - ctx, span := tracer.Start(ctx, "SaveMetaRootStruct") + spanAttrs := trace.WithAttributes( + attribute.Int64("owner.id", int64(ownerId)), + ) + + ctx, span := tracer.Start(ctx, "SaveMetaRootStruct", spanAttrs) defer span.End() dataItem := reflect.ValueOf(data)