spanstore

package
v0.0.0-...-be244c0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BearerTokenKey = "bearer.token"

BearerTokenKey is the string literal used internally in the implementation of this context.

View Source
const StoragePropagationKey = "storage.propagate.token"

StoragePropagationKey is a key for viper configuration to pass this option to storage plugins.

Variables

View Source
var (
	// ErrTraceNotFound is returned by Reader's GetTrace if no data is found for given trace ID.
	ErrTraceNotFound = errors.New("trace not found")
)

Functions

func ContextWithBearerToken

func ContextWithBearerToken(ctx context.Context, token string) context.Context

ContextWithBearerToken set bearer token in context

func GetBearerToken

func GetBearerToken(ctx context.Context) (string, bool)

GetBearerToken from context, or empty string if there is no token

Types

type CompositeWriter

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

CompositeWriter is a span Writer that tries to save spans into several underlying span Writers

func NewCompositeWriter

func NewCompositeWriter(spanWriters ...Writer) *CompositeWriter

NewCompositeWriter creates a CompositeWriter

func (*CompositeWriter) WriteSpan

func (c *CompositeWriter) WriteSpan(ctx context.Context, span *model.Span) error

WriteSpan calls WriteSpan on each span writer. It will sum up failures, it is not transactional

type DownsamplingOptions

type DownsamplingOptions struct {
	Ratio          float64
	HashSalt       string
	MetricsFactory metrics.Factory
}

DownsamplingOptions contains the options for constructing a DownsamplingWriter.

type DownsamplingWriter

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

DownsamplingWriter is a span Writer that drops spans with a predefined downsamplingRatio.

func NewDownsamplingWriter

func NewDownsamplingWriter(spanWriter Writer, downsamplingOptions DownsamplingOptions) *DownsamplingWriter

NewDownsamplingWriter creates a DownsamplingWriter.

func (*DownsamplingWriter) WriteSpan

func (ds *DownsamplingWriter) WriteSpan(ctx context.Context, span *model.Span) error

WriteSpan calls WriteSpan on wrapped span writer.

type Operation

type Operation struct {
	Name     string
	SpanKind string
}

Operation contains operation name and span kind

type OperationQueryParameters

type OperationQueryParameters struct {
	ServiceName string
	SpanKind    string
}

OperationQueryParameters contains parameters of query operations, empty spanKind means get operations for all kinds of span.

type Reader

type Reader interface {
	GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)
	GetServices(ctx context.Context) ([]string, error)
	GetOperations(ctx context.Context, query OperationQueryParameters) ([]Operation, error)
	FindTraces(ctx context.Context, query *TraceQueryParameters) ([]*model.Trace, error)
	FindTraceIDs(ctx context.Context, query *TraceQueryParameters) ([]model.TraceID, error)
}

Reader finds and loads traces and other data from storage.

type Sampler

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

Sampler decides if we should sample a span

func NewSampler

func NewSampler(ratio float64, hashSalt string) *Sampler

NewSampler creates SamplingExecutor

func (*Sampler) ShouldSample

func (s *Sampler) ShouldSample(span *model.Span) bool

ShouldSample decides if a span should be sampled

type TraceQueryParameters

type TraceQueryParameters struct {
	ServiceName   string
	OperationName string
	Tags          map[string]string
	StartTimeMin  time.Time
	StartTimeMax  time.Time
	DurationMin   time.Duration
	DurationMax   time.Duration
	NumTraces     int
}

TraceQueryParameters contains parameters of a trace query.

type Writer

type Writer interface {
	WriteSpan(ctx context.Context, span *model.Span) error
}

Writer writes spans to storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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