This commit is contained in:
Asim Aslam
2020-01-24 21:31:57 +00:00
parent 49cc022ca2
commit 2b1844971c
3 changed files with 9 additions and 4 deletions

View File

@@ -36,6 +36,11 @@ type Span struct {
type spanKey struct{}
var (
// Default tracer
DefaultTrace = NewTrace()
)
// FromContext returns a span from context
func FromContext(ctx context.Context) (*Span, bool) {
s, ok := ctx.Value(spanKey{}).(*Span)