Signed-off-by: Andres Taylor <antaylor@squareup.com>
This commit is contained in:
Andres Taylor 2019-03-20 10:21:42 -07:00
Родитель 2b52464112
Коммит 487135e5f8
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -89,8 +89,13 @@ func CopySpan(parentCtx, spanCtx context.Context) context.Context {
// SpanFactory is an interface for creating spans or extracting them from Contexts.
type SpanFactory interface {
// New creates a new span from an existing one, if provided. The parent can also be nil
New(parent Span, label string, spanType SpanType) Span
// Extracts a span from a context, making it possible to annotate the span with additional information.
FromContext(ctx context.Context) (Span, bool)
// Creates a new context containing the provided span
NewContext(parent context.Context, span Span) context.Context
}