From 65ac3aff56248cc0e808fb02a3b871187cf97945 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 6 May 2024 01:09:41 +0300 Subject: [PATCH] fixup add labels Signed-off-by: Vasiliy Tolstov --- opentracing.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opentracing.go b/opentracing.go index 0c1865f..d73f2e1 100644 --- a/opentracing.go +++ b/opentracing.go @@ -128,14 +128,15 @@ func (os *otSpan) Finish(opts ...tracer.SpanOption) { return } - l := len(options.Labels) + labels := append(options.Labels, os.labels...) + l := len(labels) for idx := 0; idx < l; idx++ { - switch lt := options.Labels[idx].(type) { + switch lt := labels[idx].(type) { case attribute.KeyValue: os.span.SetTag(string(lt.Key), lt.Value.AsInterface()) case string: if l > idx+1 { - os.span.SetTag(lt, options.Labels[idx+1]) + os.span.SetTag(lt, labels[idx+1]) idx++ } }