fixup add labels
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
e9933df477
commit
65ac3aff56
@ -128,14 +128,15 @@ func (os *otSpan) Finish(opts ...tracer.SpanOption) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
l := len(options.Labels)
|
labels := append(options.Labels, os.labels...)
|
||||||
|
l := len(labels)
|
||||||
for idx := 0; idx < l; idx++ {
|
for idx := 0; idx < l; idx++ {
|
||||||
switch lt := options.Labels[idx].(type) {
|
switch lt := labels[idx].(type) {
|
||||||
case attribute.KeyValue:
|
case attribute.KeyValue:
|
||||||
os.span.SetTag(string(lt.Key), lt.Value.AsInterface())
|
os.span.SetTag(string(lt.Key), lt.Value.AsInterface())
|
||||||
case string:
|
case string:
|
||||||
if l > idx+1 {
|
if l > idx+1 {
|
||||||
os.span.SetTag(lt, options.Labels[idx+1])
|
os.span.SetTag(lt, labels[idx+1])
|
||||||
idx++
|
idx++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user