Documentation
¶
Index ¶
- Variables
- func AppendSpanKVs(ctx context.Context, keyvals ...interface{})
- func ApplyConfig(cfg Config)
- func ContextWithKVs(ctx context.Context, keyvals ...interface{}) context.Context
- func EndSpan(ctx context.Context, err error)
- func ExportSpan(s *span)
- func GRPCClientKVs(service, method string) []interface{}
- func GRPCServerKVs(service, method string) []interface{}
- func HTTPClientKVs(req *http.Request) []interface{}
- func HTTPServerKVs(req *http.Request) []interface{}
- func HTTPServerResponseKVs(status string) []interface{}
- func InternalFuncKVs() []interface{}
- func KVsFromContext(ctx context.Context) []interface{}
- func LogSpan(ctx context.Context, s *span)
- func QueueConsumerKVs() []interface{}
- func QueueProducerKVs() []interface{}
- func RecordPanic(ctx context.Context)
- func RegisterExporter(e Exporter)
- func SpanFromContext(ctx context.Context) *span
- func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *span)
- func StreamClientInterceptor() grpc.StreamClientInterceptor
- func StreamServerInterceptor() grpc.StreamServerInterceptor
- func TraceFunc(ctx context.Context, name string, f func(context.Context) error) (err error)
- func TraceHTTPRequest(do func(*http.Request) (*http.Response, error), baseName string, ...) (resp *http.Response, err error)
- func UnaryClientInterceptor() grpc.UnaryClientInterceptor
- func UnaryServerInterceptor() grpc.UnaryServerInterceptor
- func UnregisterExporter(e Exporter)
- func XMLRPCClientKVs(method, serverURL string, err error) []interface{}
- type Config
- type Exporter
- type FaultError
- type HTTPTransport
- type IDGenerator
- type Sampler
- type SamplingParameters
- type SpanData
- type SpanID
- type StartOption
- type StartOptions
- type TraceID
Constants ¶
This section is empty.
Variables ¶
var ErrMissingValue = errors.New("(MISSING)")
Functions ¶
func AppendSpanKVs ¶
func ApplyConfig ¶
func ApplyConfig(cfg Config)
func ContextWithKVs ¶
func ExportSpan ¶
func ExportSpan(s *span)
func GRPCClientKVs ¶
func GRPCClientKVs(service, method string) []interface{}
func GRPCServerKVs ¶
func GRPCServerKVs(service, method string) []interface{}
func HTTPClientKVs ¶
func HTTPServerKVs ¶
func HTTPServerResponseKVs ¶
func HTTPServerResponseKVs(status string) []interface{}
func InternalFuncKVs ¶
func InternalFuncKVs() []interface{}
func KVsFromContext ¶
func QueueConsumerKVs ¶
func QueueConsumerKVs() []interface{}
func QueueProducerKVs ¶
func QueueProducerKVs() []interface{}
func RecordPanic ¶
If this method is called while panicing, function will record the panic into the span, and the panic is continued. 1. The function should be called before `EndSpan(ctx context.Context, err error)` or `(*span).End()`. 2. The function call should be deferred.
func RegisterExporter ¶
func RegisterExporter(e Exporter)
RegisterExporter adds to the list of Exporters that will receive sampled trace spans.
func SpanFromContext ¶
func StreamClientInterceptor ¶
func StreamClientInterceptor() grpc.StreamClientInterceptor
func StreamServerInterceptor ¶
func StreamServerInterceptor() grpc.StreamServerInterceptor
func TraceHTTPRequest ¶
func UnaryClientInterceptor ¶
func UnaryClientInterceptor() grpc.UnaryClientInterceptor
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
func UnregisterExporter ¶
func UnregisterExporter(e Exporter)
UnregisterExporter removes from the list of Exporters the Exporter that was registered with the given name.
func XMLRPCClientKVs ¶
Types ¶
type Config ¶
type Config struct { DefaultSampler Sampler IDGenerator IDGenerator }
Config represents the global tracing configuration.
type FaultError ¶
func AssertFaultError ¶
func AssertFaultError(err error) (*FaultError, bool)
type HTTPTransport ¶
type HTTPTransport struct { BaseName string RoundTripper http.RoundTripper }
type IDGenerator ¶
type Sampler ¶
type Sampler func(SamplingParameters) bool
func AlwaysSample ¶
func AlwaysSample() Sampler
func NeverSample ¶
func NeverSample() Sampler
func ProbabilitySampler ¶
type SamplingParameters ¶
type SpanData ¶
type SpanData struct { ParentSpanID SpanID TraceID SpanID Name string IsSampled bool StartTime time.Time EndTime time.Time Err error Panic interface{} Keyvals []interface{} }
SpanData contains all the information collected by a Span.
type SpanID ¶
type SpanID [8]byte
SpanID is a unique identity of a span in a trace.
func (SpanID) IsValid ¶
IsValid checks whether the SpanID is valid. A valid SpanID does not consist of zeros only.
func (SpanID) MarshalJSON ¶
MarshalJSON implements a custom marshal function to encode SpanID as a hex string.
type StartOption ¶
type StartOption func(*StartOptions)
func WithParentSpanID ¶
func WithParentSpanID(id SpanID) StartOption
func WithSampler ¶
func WithSampler(sampler Sampler) StartOption
func WithStartTime ¶
func WithStartTime(t time.Time) StartOption
func WithTraceID ¶
func WithTraceID(id TraceID) StartOption
type StartOptions ¶
type TraceID ¶
type TraceID [16]byte
TraceID is a unique identity of a trace. nolint:revive // revive complains about stutter of `trace.TraceID`.
func (TraceID) IsValid ¶
IsValid checks whether the trace TraceID is valid. A valid trace ID does not consist of zeros only.
func (TraceID) MarshalJSON ¶
MarshalJSON implements a custom marshal function to encode TraceID as a hex string.