ext.go 870 B

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