Documentation ¶
Index ¶
- type HTTPClient
- type Mutex
- type TracedServeMux
- type TracingEngine
- func (engine *TracingEngine) CreateChildSpan(ctx context.Context, name string) opentracing.Span
- func (engine *TracingEngine) Extract(tracer opentracing.Tracer, r *http.Request) (opentracing.SpanContext, error)
- func (engine *TracingEngine) Inject(span opentracing.Span, request *http.Request) error
- func (engine *TracingEngine) NewTracedRequest(method string, url string, span opentracing.Span) (*http.Request, error)
- func (engine *TracingEngine) OpenTracingMiddleware(next http.Handler) http.Handler
- func (engine *TracingEngine) TraceFunction(ctx context.Context, fn interface{}, params ...interface{}) (result []reflect.Value)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
type HTTPClient struct { TracerEngine *TracingEngine Client *http.Client }
HTTPClient wraps an http.Client with tracing instrumentation.
func NewHTTPClient ¶
func NewHTTPClient(tracer *TracingEngine) *HTTPClient
type Mutex ¶
type Mutex struct { SessionBaggageKey string // contains filtered or unexported fields }
Mutex is just like the standard sync.Mutex, except that it is aware of the Context and logs some diagnostic information into the current span.
type TracedServeMux ¶
type TracedServeMux struct {
// contains filtered or unexported fields
}
TracedServeMux is a wrapper around http.ServeMux that instruments handlers for tracing.
func NewServeMux ¶
func NewServeMux(tracer opentracing.Tracer) *TracedServeMux
NewServeMux creates a new TracedServeMux.
func (*TracedServeMux) Handle ¶
func (tm *TracedServeMux) Handle(pattern string, handler http.Handler)
Handle implements http.ServeMux#Handle
func (*TracedServeMux) ServeHTTP ¶
func (tm *TracedServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.ServeMux#ServeHTTP
type TracingEngine ¶
type TracingEngine struct {
Tracer opentracing.Tracer
}
func NewTracer ¶
func NewTracer(service string, collectorEndpoint string, metricsFactory metrics.Factory) (*TracingEngine, io.Closer)
Init returns an instance of Jaeger Tracer that samples 100% of traces and logs all spans to stdout.
func (*TracingEngine) CreateChildSpan ¶
func (engine *TracingEngine) CreateChildSpan(ctx context.Context, name string) opentracing.Span
CreateChildSpan creates a new opentracing span adding tags for the span name and caller details. Returns a Span. User must call `defer sp.Finish()`
func (*TracingEngine) Extract ¶
func (engine *TracingEngine) Extract(tracer opentracing.Tracer, r *http.Request) (opentracing.SpanContext, error)
func (*TracingEngine) Inject ¶
func (engine *TracingEngine) Inject(span opentracing.Span, request *http.Request) error
func (*TracingEngine) NewTracedRequest ¶
func (engine *TracingEngine) NewTracedRequest(method string, url string, span opentracing.Span) (*http.Request, error)
NewTracedRequest generates a new traced HTTP request with opentracing headers injected into it
func (*TracingEngine) OpenTracingMiddleware ¶
func (engine *TracingEngine) OpenTracingMiddleware(next http.Handler) http.Handler
func (*TracingEngine) TraceFunction ¶
func (engine *TracingEngine) TraceFunction(ctx context.Context, fn interface{}, params ...interface{}) (result []reflect.Value)
TraceFunction wraps funtion with opentracing span adding tags for the function name and caller details