add span status method

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-01-18 09:48:58 +03:00
parent f76b3171d9
commit 7137d99102
4 changed files with 58 additions and 10 deletions

View File

@@ -33,10 +33,12 @@ func (t *noopTracer) Name() string {
}
type noopSpan struct {
ctx context.Context
tracer Tracer
name string
opts SpanOptions
ctx context.Context
tracer Tracer
name string
opts SpanOptions
status SpanStatus
statusMsg string
}
func (s *noopSpan) Finish(opts ...SpanOption) {
@@ -69,6 +71,15 @@ func (s *noopSpan) Kind() SpanKind {
return s.opts.Kind
}
func (s *noopSpan) Status() (SpanStatus, string) {
return s.status, s.statusMsg
}
func (s *noopSpan) SetStatus(st SpanStatus, msg string) {
s.status = st
s.statusMsg = msg
}
// NewTracer returns new memory tracer
func NewTracer(opts ...Option) Tracer {
return &noopTracer{