Maninder | 12b909f | 2020-10-23 14:23:36 +0530 | [diff] [blame] | 1 | package opentracing |
| 2 | |
| 3 | import ( |
| 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. |
| 14 | type 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 | } |