jaeger

package
v0.6.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJaegerThrift

func BuildJaegerThrift(span *Span) *j.Span

func Init

func Init()

Init Init

Types

type Config

type Config struct {
	Endpoint  string
	BatchSize int
}

type HTTPBasicAuthCredentials

type HTTPBasicAuthCredentials struct {
	// contains filtered or unexported fields
}

HTTPBasicAuthCredentials stores credentials for HTTP basic auth.

type HTTPOption

type HTTPOption func(c *HTTPTransport)

HTTPOption sets a parameter for the HttpCollector

func HTTPBasicAuth

func HTTPBasicAuth(username string, password string) HTTPOption

HTTPBasicAuth sets the credentials required to perform HTTP basic auth

func HTTPBatchSize

func HTTPBatchSize(n int) HTTPOption

HTTPBatchSize sets the maximum batch size, after which a collect will be triggered. The default batch size is 100 spans.

func HTTPHeaders

func HTTPHeaders(headers map[string]string) HTTPOption

HTTPHeaders defines the HTTP headers that will be attached to the jaeger client's HTTP request

func HTTPRoundTripper

func HTTPRoundTripper(transport http.RoundTripper) HTTPOption

HTTPRoundTripper configures the underlying Transport on the *http.Client that is used

func HTTPTimeout

func HTTPTimeout(duration time.Duration) HTTPOption

HTTPTimeout sets maximum timeout for http request.

type HTTPTransport

type HTTPTransport struct {
	// contains filtered or unexported fields
}

HTTPTransport implements Transport by forwarding spans to a http server.

func NewHTTPTransport

func NewHTTPTransport(url string, options ...HTTPOption) *HTTPTransport

NewHTTPTransport returns a new HTTP-backend transport. url should be an http url of the collector to handle POST request, typically something like:

http://hostname:14268/api/traces?format=jaeger.thrift

func (*HTTPTransport) Append

func (c *HTTPTransport) Append(span *Span) (int, error)

Append implements Transport.

func (*HTTPTransport) Close

func (c *HTTPTransport) Close() error

Close implements Transport.

func (*HTTPTransport) Flush

func (c *HTTPTransport) Flush() (int, error)

Flush implements Transport.

type JaegerReporter

type JaegerReporter struct {
	// contains filtered or unexported fields
}

func (*JaegerReporter) Close

func (rpt *JaegerReporter) Close() error

func (*JaegerReporter) WriteSpan

func (r *JaegerReporter) WriteSpan(raw *trace.Span) (err error)

type Reference

type Reference struct {
	Type    opentracing.SpanReferenceType
	Context SpanContext
}

Reference represents a causal reference to other Spans (via their SpanContext).

type Span

type Span struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Span implements opentracing.Span

func (*Span) BaggageItem

func (s *Span) BaggageItem(key string) string

BaggageItem implements BaggageItem() of opentracing.SpanContext

func (*Span) Context

func (s *Span) Context() opentracing.SpanContext

Context implements opentracing.Span API

func (*Span) Duration

func (s *Span) Duration() time.Duration

Duration returns span duration

func (*Span) Finish

func (s *Span) Finish()

Finish implements opentracing.Span API After finishing the Span object it returns back to the allocator unless the reporter retains it again, so after that, the Span object should no longer be used because it won't be valid anymore.

func (*Span) FinishWithOptions

func (s *Span) FinishWithOptions(options opentracing.FinishOptions)

FinishWithOptions implements opentracing.Span API

func (*Span) Log

func (s *Span) Log(ld opentracing.LogData)

Log implements opentracing.Span API

func (*Span) LogEvent

func (s *Span) LogEvent(event string)

LogEvent implements opentracing.Span API

func (*Span) LogEventWithPayload

func (s *Span) LogEventWithPayload(event string, payload interface{})

LogEventWithPayload implements opentracing.Span API

func (*Span) LogFields

func (s *Span) LogFields(fields ...log.Field)

LogFields implements opentracing.Span API

func (*Span) LogKV

func (s *Span) LogKV(alternatingKeyValues ...interface{})

LogKV implements opentracing.Span API

func (*Span) Logs

func (s *Span) Logs() []opentracing.LogRecord

Logs returns micro logs for span

func (*Span) OperationName

func (s *Span) OperationName() string

OperationName allows retrieving current operation name.

func (*Span) References

func (s *Span) References() []opentracing.SpanReference

References returns references for this span

func (*Span) Release

func (s *Span) Release()

Release decrements object counter and return to the allocator manager when counter will below zero

func (*Span) Retain

func (s *Span) Retain() *Span

Retain increases object counter to increase the lifetime of the object

func (*Span) ServiceName

func (s *Span) ServiceName() string

func (*Span) SetBaggageItem

func (s *Span) SetBaggageItem(key, value string) opentracing.Span

SetBaggageItem implements SetBaggageItem() of opentracing.SpanContext

func (*Span) SetOperationName

func (s *Span) SetOperationName(operationName string) opentracing.Span

SetOperationName sets or changes the operation name.

func (*Span) SetTag

func (s *Span) SetTag(key string, value interface{}) opentracing.Span

SetTag implements SetTag() of opentracing.Span

func (*Span) SpanContext

func (s *Span) SpanContext() SpanContext

SpanContext returns span context

func (*Span) StartTime

func (s *Span) StartTime() time.Time

StartTime returns span start time

func (*Span) String

func (s *Span) String() string

func (*Span) Tags

func (s *Span) Tags() opentracing.Tags

Tags returns tags for span

func (*Span) Tracer

func (s *Span) Tracer() opentracing.Tracer

Tracer implements opentracing.Span API

type SpanContext

type SpanContext struct {
	// contains filtered or unexported fields
}

SpanContext represents propagated span identity and state

func ContextFromString

func ContextFromString(value string) (SpanContext, error)

ContextFromString reconstructs the Context encoded in a string

func NewSpanContext

func NewSpanContext(traceID TraceID, spanID, parentID SpanID, sampled bool, baggage map[string]string) SpanContext

NewSpanContext creates a new instance of SpanContext

func (*SpanContext) CopyFrom

func (c *SpanContext) CopyFrom(ctx *SpanContext)

CopyFrom copies data from ctx into this context, including span identity and baggage. TODO This is only used by interop.go. Remove once TChannel Go supports OpenTracing.

func (SpanContext) ExtendedSamplingState

func (c SpanContext) ExtendedSamplingState(key interface{}, initValue func() interface{}) interface{}

ExtendedSamplingState returns the custom state object for a given key. If the value for this key does not exist, it is initialized via initValue function. This state can be used by samplers (e.g. x.PrioritySampler).

func (SpanContext) Flags

func (c SpanContext) Flags() byte

Flags returns the bitmap containing such bits as 'sampled' and 'debug'.

func (SpanContext) ForeachBaggageItem

func (c SpanContext) ForeachBaggageItem(handler func(k, v string) bool)

ForeachBaggageItem implements ForeachBaggageItem() of opentracing.SpanContext

func (SpanContext) IsDebug

func (c SpanContext) IsDebug() bool

IsDebug indicates whether sampling was explicitly requested by the service.

func (SpanContext) IsFirehose

func (c SpanContext) IsFirehose() bool

IsFirehose indicates whether the firehose flag was set

func (SpanContext) IsSampled

func (c SpanContext) IsSampled() bool

IsSampled returns whether this trace was chosen for permanent storage by the sampling mechanism of the tracer.

func (SpanContext) IsSamplingFinalized

func (c SpanContext) IsSamplingFinalized() bool

IsSamplingFinalized indicates whether the sampling decision has been finalized.

func (SpanContext) IsValid

func (c SpanContext) IsValid() bool

IsValid indicates whether this context actually represents a valid trace.

func (SpanContext) ParentID

func (c SpanContext) ParentID() SpanID

ParentID returns the parent span ID of this span context

func (SpanContext) SetFirehose

func (c SpanContext) SetFirehose()

SetFirehose enables firehose mode for this trace.

func (SpanContext) SpanID

func (c SpanContext) SpanID() SpanID

SpanID returns the span ID of this span context

func (SpanContext) String

func (c SpanContext) String() string

func (SpanContext) TraceID

func (c SpanContext) TraceID() TraceID

TraceID returns the trace ID of this span context

func (SpanContext) WithBaggageItem

func (c SpanContext) WithBaggageItem(key, value string) SpanContext

WithBaggageItem creates a new context with an extra baggage item.

type SpanID

type SpanID uint64

SpanID represents unique 64bit identifier of a span

func SpanIDFromString

func SpanIDFromString(s string) (SpanID, error)

SpanIDFromString creates a SpanID from a hexadecimal string

func (SpanID) String

func (s SpanID) String() string

type Tag

type Tag struct {
	// contains filtered or unexported fields
}

Tag is a simple key value wrapper. TODO (breaking change) deprecate in the next major release, use opentracing.Tag instead.

func NewTag

func NewTag(key string, value interface{}) Tag

NewTag creates a new Tag. TODO (breaking change) deprecate in the next major release, use opentracing.Tag instead.

type TraceID

type TraceID struct {
	High, Low uint64
}

TraceID represents unique 128bit identifier of a trace

func TraceIDFromString

func TraceIDFromString(s string) (TraceID, error)

TraceIDFromString creates a TraceID from a hexadecimal string

func (TraceID) IsValid

func (t TraceID) IsValid() bool

IsValid checks if the trace ID is valid, i.e. not zero.

func (TraceID) String

func (t TraceID) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL