Merge pull request '#347 add Sort Labels' (#47) from kgorbunov/micro-tracer-opentracing:#347-v3 into v3
Reviewed-on: #47
This commit is contained in:
commit
31350e8c21
@ -10,6 +10,7 @@ import (
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.unistack.org/micro/v3/metadata"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
"go.unistack.org/micro/v3/util/sort"
|
||||
)
|
||||
|
||||
var _ tracer.Tracer = &otTracer{}
|
||||
@ -183,6 +184,8 @@ func (os *otSpan) Finish(opts ...tracer.SpanOption) {
|
||||
options.Labels = options.Labels[:len(options.Labels)-1]
|
||||
}
|
||||
|
||||
os.opts.Labels = sort.Uniq(os.opts.Labels)
|
||||
|
||||
l := len(options.Labels)
|
||||
for idx := 0; idx < l; idx++ {
|
||||
switch lt := options.Labels[idx].(type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user