add tracer enabled status
All checks were successful
coverage / build (push) Successful in 1m39s
test / test (push) Successful in 4m22s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-05-19 09:42:38 +03:00
parent 979dde6c24
commit 9294657af5
3 changed files with 7 additions and 1 deletions

View File

@@ -261,6 +261,10 @@ func (t *otTracer) startSpanFromAny(ctx context.Context, name string, opts ...ot
return t.startSpanFromContext(ctx, name, opts...)
}
func (t *otTracer) Enabled() bool {
return t.opts.Enabled
}
func (t *otTracer) startSpanFromContext(ctx context.Context, name string, opts ...ot.StartSpanOption) (context.Context, ot.Span) {
var parentSpan ot.Span
if tracerSpan, ok := tracer.SpanFromContext(ctx); ok && tracerSpan != nil {