add SpanAttribute

Signed-off-by: Swagat Bora <sbora@amazon.com>
This commit is contained in:
Swagat Bora
2022-11-03 16:50:50 +00:00
parent 3b87d46ce2
commit ee64926a72
11 changed files with 114 additions and 96 deletions

View File

@@ -20,6 +20,7 @@ import (
"context"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
)
@@ -52,3 +53,7 @@ func SetSpanStatus(span trace.Span, err error) {
span.SetStatus(codes.Ok, "")
}
}
func SpanAttribute(k string, v interface{}) attribute.KeyValue {
return any(k, v)
}