Documentation
¶
Index ¶
- func DefaultConfiguration(service, addr string) *config.Configuration
- func EnablePrometheusMetrics() error
- func InitWarnLogger(logger WarnLogger)
- func InjectBinary(ctx context.Context, carrier io.Writer) error
- func InjectHeaders(ctx context.Context, carrier http.Header) error
- func InjectMap(ctx context.Context, carrier map[string]string) error
- func LogKV(ctx context.Context, key string, value interface{})
- func SpanFromContext(ctx context.Context) opentracing.Span
- type Span
- func (s *Span) BaggageItem(restrictedKey string) string
- func (s *Span) Context() opentracing.SpanContext
- func (s *Span) Finish()
- func (s *Span) FinishWithOptions(opts opentracing.FinishOptions)
- func (s *Span) Log(data opentracing.LogData)deprecated
- func (s *Span) LogEvent(event string)deprecated
- func (s *Span) LogEventWithPayload(event string, payload interface{})deprecated
- func (s *Span) LogFields(fields ...log.Field)
- func (s *Span) LogKV(alternatingKeyValues ...interface{})
- func (s *Span) SetBaggageItem(restrictedKey, value string) opentracing.Span
- func (s *Span) SetOperationName(operationName string) opentracing.Span
- func (s *Span) SetTag(key string, value interface{}) opentracing.Span
- func (s *Span) Tracer() opentracing.Tracer
- type SpanBuilder
- func (b SpanBuilder) Build() opentracing.Span
- func (b SpanBuilder) BuildWithContext(ctx context.Context) (opentracing.Span, context.Context)
- func (b SpanBuilder) ExtractBinary(carrier []byte) SpanBuilder
- func (b SpanBuilder) ExtractHeaders(carrier http.Header) SpanBuilder
- func (b SpanBuilder) ExtractMap(carrier map[string]string) SpanBuilder
- func (b SpanBuilder) WithName(name string) SpanBuilder
- type Tracer
- type WarnLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfiguration ¶
func DefaultConfiguration(service, addr string) *config.Configuration
func EnablePrometheusMetrics ¶ added in v0.13.0
func EnablePrometheusMetrics() error
func InitWarnLogger ¶
func InitWarnLogger(logger WarnLogger)
func LogKV ¶
LogKV is a concise, readable way to record key:value logging data about a Span, though unfortunately this also makes it less efficient and less type-safe than LogFields(). Here's an example:
span.LogKV(
"event", "soft error",
"type", "cache timeout",
"waited.millis", 1500)
For LogKV (as opposed to LogFields()), the parameters must appear as key-value pairs, like
span.LogKV(key1, val1, key2, val2, key3, val3, ...)
The keys must all be strings. The values may be strings, numeric types, bools, Go error instances, or arbitrary structs.
(Note to implementors: consider the log.InterleavedKVToFields() helper).
func SpanFromContext ¶
func SpanFromContext(ctx context.Context) opentracing.Span
Types ¶
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
func FollowsSpan ¶
func (*Span) BaggageItem ¶
func (*Span) Context ¶
func (s *Span) Context() opentracing.SpanContext
func (*Span) FinishWithOptions ¶
func (s *Span) FinishWithOptions(opts opentracing.FinishOptions)
func (*Span) Log
deprecated
func (s *Span) Log(data opentracing.LogData)
Deprecated: use LogFields or LogKV.
func (*Span) LogEventWithPayload
deprecated
func (*Span) SetBaggageItem ¶
func (s *Span) SetBaggageItem(restrictedKey, value string) opentracing.Span
func (*Span) SetOperationName ¶
func (s *Span) SetOperationName(operationName string) opentracing.Span
func (*Span) Tracer ¶
func (s *Span) Tracer() opentracing.Tracer
type SpanBuilder ¶
type SpanBuilder struct {
// contains filtered or unexported fields
}
func (SpanBuilder) Build ¶
func (b SpanBuilder) Build() opentracing.Span
func (SpanBuilder) BuildWithContext ¶
func (b SpanBuilder) BuildWithContext(ctx context.Context) (opentracing.Span, context.Context)
func (SpanBuilder) ExtractBinary ¶
func (b SpanBuilder) ExtractBinary(carrier []byte) SpanBuilder
func (SpanBuilder) ExtractHeaders ¶
func (b SpanBuilder) ExtractHeaders(carrier http.Header) SpanBuilder
func (SpanBuilder) ExtractMap ¶
func (b SpanBuilder) ExtractMap(carrier map[string]string) SpanBuilder
func (SpanBuilder) WithName ¶
func (b SpanBuilder) WithName(name string) SpanBuilder
type Tracer ¶
type Tracer struct {
opentracing.Tracer
// contains filtered or unexported fields
}
func (*Tracer) NewSpan ¶
func (c *Tracer) NewSpan() SpanBuilder
func (*Tracer) OpenTracer ¶
func (c *Tracer) OpenTracer() opentracing.Tracer
type WarnLogger ¶
type WarnLogger interface {
Warnf(template string, args ...interface{})
}
Click to show internal directories.
Click to hide internal directories.