forked from TrueCloudLab/frostfs-api-go
[#12] tracing: Add tracing package
Add tracing config, implementation and setup Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
3a7280968b
commit
816628d37d
6 changed files with 807 additions and 0 deletions
12
pkg/tracing/span.go
Normal file
12
pkg/tracing/span.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
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...)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue