frostfs-api-go/pkg/tracing/span.go
Evgenii Stratonikov 0c67b8fefa [#34] tracing: use atomic.Pointer
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-19 14:40:17 +03:00

12 lines
369 B
Go

package tracing
import (
"context"
"go.opentelemetry.io/otel/trace"
)
// StartSpanFromContext creates a span and a context.Context containing the newly-created span.
func StartSpanFromContext(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return tracer.Load().Tracer.Start(ctx, operationName, opts...)
}