Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpMiddleware ¶
type HttpMiddleware struct {
// contains filtered or unexported fields
}
func NewHttpMiddleware ¶
func NewHttpMiddleware(tracer opentracing.Tracer, opts ...HttpOption) *HttpMiddleware
func (*HttpMiddleware) Handle ¶
func (m *HttpMiddleware) Handle(h http.HandlerFunc) http.HandlerFunc
type HttpOption ¶
type HttpOption interface {
// contains filtered or unexported methods
}
func WithHttpComponentName ¶
func WithHttpComponentName(componentName string) HttpOption
WithHttpComponentName set component name
func WithHttpEnable ¶
func WithHttpEnable(enable bool) HttpOption
WithHttpEnable disable to collect trace
func WithHttpLogger ¶
func WithHttpLogger(logger logrus.FieldLogger) HttpOption
WithHttpLogger set logger
func WithHttpOpNameFunc ¶
func WithHttpOpNameFunc(fn func(r *http.Request) string) HttpOption
WithHttpOpNameFunc set function to get operation name for span
type InjectHook ¶
func (*InjectHook) Levels ¶
func (hook *InjectHook) Levels() []logrus.Level
type Transport ¶
type Transport struct { // The actual RoundTripper to use for the request. A nil // RoundTripper defaults to http.DefaultTransport. http.RoundTripper // contains filtered or unexported fields }
Transport wraps a RoundTripper. If a request is being traced with Tracer, Transport will inject the current span into the headers, and set HTTP related tags on the span.
func NewTransport ¶
func NewTransport(tr opentracing.Tracer, options ...TransportOption) *Transport
NewTransport return a transport for http trace
type TransportOption ¶
type TransportOption func(*transportOptions)
func TransportComponentName ¶
func TransportComponentName(componentName string) TransportOption
func TransportOperationNameFunc ¶
func TransportOperationNameFunc(operationNameFunc func(req *http.Request) string) TransportOption
Click to show internal directories.
Click to hide internal directories.