spanstore

package
v1.34.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 586

Documentation

Index

Constants

This section is empty.

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

This section is empty.

Types

type CompositeWriter added in v1.3.0

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 added in v1.3.0

func NewCompositeWriter(spanWriters ...Writer) *CompositeWriter

NewCompositeWriter creates a CompositeWriter

func (*CompositeWriter) WriteSpan added in v1.3.0

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 added in v1.12.0

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

DownsamplingOptions contains the options for constructing a DownsamplingWriter.

type DownsamplingWriter added in v1.12.0

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

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

func NewDownsamplingWriter added in v1.12.0

func NewDownsamplingWriter(spanWriter Writer, downsamplingOptions DownsamplingOptions) *DownsamplingWriter

NewDownsamplingWriter creates a DownsamplingWriter.

func (*DownsamplingWriter) WriteSpan added in v1.12.0

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

WriteSpan calls WriteSpan on wrapped span writer.

type Operation added in v1.16.0

type Operation struct {
	Name     string
	SpanKind string
}

Operation contains operation name and span kind

type OperationQueryParameters added in v1.16.0

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 retrieves the trace with a given id.
	//
	// If no spans are stored for this trace, it returns ErrTraceNotFound.
	GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

	// GetServices returns all service names known to the backend from spans
	// within its retention period.
	GetServices(ctx context.Context) ([]string, error)

	// GetOperations returns all operation names for a given service
	// known to the backend from spans within its retention period.
	GetOperations(ctx context.Context, query OperationQueryParameters) ([]Operation, error)

	// FindTraces returns all traces matching query parameters. There's currently
	// an implementation-dependent abiguity whether all query filters (such as
	// multiple tags) must apply to the same span within a trace, or can be satisfied
	// by different spans.
	//
	// If no matching traces are found, the function returns (nil, nil).
	FindTraces(ctx context.Context, query *TraceQueryParameters) ([]*model.Trace, error)

	// FindTraceIDs does the same search as FindTraces, but returns only the list
	// of matching trace IDs.
	//
	// If no matching traces are found, the function returns (nil, nil).
	FindTraceIDs(ctx context.Context, query *TraceQueryParameters) ([]model.TraceID, error)
}

Reader finds and loads traces and other data from storage.

type Sampler added in v1.14.0

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

Sampler decides if we should sample a span

func NewSampler added in v1.14.0

func NewSampler(ratio float64, hashSalt string) *Sampler

NewSampler creates SamplingExecutor

func (*Sampler) ShouldSample added in v1.14.0

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