frostfs-api-go/pkg/tracing/span.go
Dmitrii Stepanov 816628d37d [#12] tracing: Add tracing package
Add tracing config, implementation and setup

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-04-11 10:55:42 +03:00

12 lines
385 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().(*tracerHolder).Tracer.Start(ctx, operationName, opts...)
}