diff --git a/tracer/memory/memory.go b/tracer/memory/memory.go index e542a228..2272a03c 100644 --- a/tracer/memory/memory.go +++ b/tracer/memory/memory.go @@ -89,6 +89,10 @@ func (s *Span) Tracer() tracer.Tracer { return s.tracer } +func (s *Span) IsRecording() bool { + return true +} + type Event struct { name string labels []interface{} diff --git a/tracer/noop.go b/tracer/noop.go index 95d4bc0c..80de5fc0 100644 --- a/tracer/noop.go +++ b/tracer/noop.go @@ -120,6 +120,10 @@ func (s *noopSpan) SetStatus(st SpanStatus, msg string) { s.statusMsg = msg } +func (s *noopSpan) IsRecording() bool { + return false +} + // NewTracer returns new memory tracer func NewTracer(opts ...Option) Tracer { return &noopTracer{ diff --git a/tracer/tracer.go b/tracer/tracer.go index b7c463c3..8979c69e 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -78,4 +78,6 @@ type Span interface { TraceID() string // SpanID returns span id SpanID() string + // IsRecording returns the recording state of the Span. + IsRecording() bool }