From e304425163a1b4d99235102bfe03ed2ebf285752 Mon Sep 17 00:00:00 2001 From: zepatrik Date: Tue, 20 Aug 2024 15:50:24 +0200 Subject: [PATCH] fix(otelx): always set error in End --- otelx/withspan.go | 1 + 1 file changed, 1 insertion(+) diff --git a/otelx/withspan.go b/otelx/withspan.go index c7da09a1..a4e06684 100644 --- a/otelx/withspan.go +++ b/otelx/withspan.go @@ -90,4 +90,5 @@ func setErrorTags(span trace.Span, err error) { span.SetAttributes(attribute.String("error.details."+k, fmt.Sprintf("%v", v))) } } + span.SetAttributes(attribute.String("error", err.Error())) }