Add span attribute owner.id for func SaveMetaRootStruct.

This commit is contained in:
Владислав Весельский 2024-03-04 16:11:12 +03:00
parent 6cc373885c
commit f588822664
1 changed files with 6 additions and 1 deletions

View File

@ -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)