From a81649d2a219f9220558d7f394209200ccf752f9 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 24 Dec 2022 19:20:22 +0300 Subject: [PATCH] tracer: add labels method Signed-off-by: Vasiliy Tolstov --- tracer/noop.go | 4 ++++ tracer/tracer.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tracer/noop.go b/tracer/noop.go index 13a2e0c7..c0defe68 100644 --- a/tracer/noop.go +++ b/tracer/noop.go @@ -60,6 +60,10 @@ func (s *noopSpan) SetLabels(labels ...interface{}) { s.opts.Labels = labels } +func (s *noopSpan) AddLabels(labels ...interface{}) { + s.opts.Labels = append(s.opts.Labels, labels...) +} + // NewTracer returns new memory tracer func NewTracer(opts ...Option) Tracer { return &noopTracer{ diff --git a/tracer/tracer.go b/tracer/tracer.go index 7d6ea856..79554502 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -31,4 +31,6 @@ type Span interface { SetName(name string) // SetLabels set the span labels SetLabels(labels ...interface{}) + // AddLabels append the span labels + AddLabels(labels ...interface{}) }