blob: e11977ebe85dbd8c0c01acbede764a76853f439a [file] [log] [blame]
khenaidoo7d3c5582021-08-11 18:09:44 -04001package opentracing
2
3import (
4 "context"
5)
6
7// TracerContextWithSpanExtension is an extension interface that the
8// implementation of the Tracer interface may want to implement. It
9// allows to have some control over the go context when the
10// ContextWithSpan is invoked.
11//
12// The primary purpose of this extension are adapters from opentracing
13// API to some other tracing API.
14type TracerContextWithSpanExtension interface {
15 // ContextWithSpanHook gets called by the ContextWithSpan
16 // function, when the Tracer implementation also implements
17 // this interface. It allows to put extra information into the
18 // context and make it available to the callers of the
19 // ContextWithSpan.
20 //
21 // This hook is invoked before the ContextWithSpan function
22 // actually puts the span into the context.
23 ContextWithSpanHook(ctx context.Context, span Span) context.Context
24}