frostfs-observability/tracing/span.go
Dmitrii Stepanov 7340de1cbd [#2] tracing: Add tracing configuration
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-05-29 12:00:29 +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...)
}