parent
62074965ee
commit
fa1427014c
@ -83,9 +83,11 @@ func (sk SpanKind) String() string {
|
||||
|
||||
// SpanOptions contains span option
|
||||
type SpanOptions struct {
|
||||
Labels []interface{}
|
||||
Kind SpanKind
|
||||
Record bool
|
||||
StatusMsg string
|
||||
Labels []interface{}
|
||||
Status SpanStatus
|
||||
Kind SpanKind
|
||||
Record bool
|
||||
}
|
||||
|
||||
// SpanOption func signature
|
||||
@ -111,6 +113,13 @@ func WithSpanLabels(kv ...interface{}) SpanOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithSpanStatus(st SpanStatus, msg string) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
o.Status = st
|
||||
o.StatusMsg = msg
|
||||
}
|
||||
}
|
||||
|
||||
func WithSpanKind(k SpanKind) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
o.Kind = k
|
||||
|
@ -44,6 +44,8 @@ type Tracer interface {
|
||||
Init(...Option) error
|
||||
// Start a trace
|
||||
Start(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span)
|
||||
// Extract get span metadata from context
|
||||
// Extract(ctx context.Context)
|
||||
// Flush flushes spans
|
||||
Flush(ctx context.Context) error
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user