From b08f5321b0439843ba1ba3df02d309b1ba710d89 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 4 May 2024 19:18:12 +0300 Subject: [PATCH] tracer: allow to skip span recording Signed-off-by: Vasiliy Tolstov --- tracer/options.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tracer/options.go b/tracer/options.go index a243f03e..4db47278 100644 --- a/tracer/options.go +++ b/tracer/options.go @@ -85,6 +85,7 @@ func (sk SpanKind) String() string { type SpanOptions struct { Labels []interface{} Kind SpanKind + Record bool } // SpanOption func signature @@ -116,6 +117,12 @@ func WithSpanKind(k SpanKind) SpanOption { } } +func WithSpanRecord(b bool) SpanOption { + return func(o *SpanOptions) { + o.Record = b + } +} + // Options struct type Options struct { // Context used to store custome tracer options