-
Notifications
You must be signed in to change notification settings - Fork 174
/
tracer.go
32 lines (25 loc) · 872 Bytes
/
tracer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package module
import (
"context"
"github.com/opentracing/opentracing-go"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module/trace"
)
var _ Tracer = &trace.OpenTracer{}
// Tracer interface for tracers in flow. Uses open tracing span definitions
type Tracer interface {
ReadyDoneAware
StartSpan(entity flow.Identifier, spanName trace.SpanName, opts ...opentracing.StartSpanOption) opentracing.Span
FinishSpan(entity flow.Identifier, spanName trace.SpanName)
GetSpan(entity flow.Identifier, spanName trace.SpanName) (opentracing.Span, bool)
StartSpanFromContext(
ctx context.Context,
operationName trace.SpanName,
opts ...opentracing.StartSpanOption,
) (opentracing.Span, context.Context)
StartSpanFromParent(
span opentracing.Span,
operationName trace.SpanName,
opts ...opentracing.StartSpanOption,
) opentracing.Span
}