spanstore

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrServiceNameNotSet occurs when attempting to query with an empty service name
	ErrServiceNameNotSet = errors.New("service name must be set")

	// ErrStartTimeMinGreaterThanMax occurs when start time min is above start time max
	ErrStartTimeMinGreaterThanMax = errors.New("min start time is above max")

	// ErrDurationMinGreaterThanMax occurs when duration min is above duration max
	ErrDurationMinGreaterThanMax = errors.New("min duration is above max")

	// ErrMalformedRequestObject occurs when a request object is nil
	ErrMalformedRequestObject = errors.New("malformed request object")

	// ErrStartAndEndTimeNotSet occurs when start time and end time are not set
	ErrStartAndEndTimeNotSet = errors.New("start and end time must be set")

	// ErrUnableToFindTraceIDAggregation occurs when an aggregation query for TraceIDs fail.
	ErrUnableToFindTraceIDAggregation = errors.New("could not find aggregation of traceIDs")

	// ErrNotSupported during development, don't support every option - yet
	ErrNotSupported = errors.New("this query parameter is not supported yet")
)

Functions

This section is empty.

Types

type CacheStore

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

CacheStore saves expensive calculations from the K/V store

func NewCacheStore

func NewCacheStore(db *badger.DB, ttl time.Duration, prefill bool) *CacheStore

NewCacheStore returns initialized CacheStore for badger use

func (*CacheStore) GetOperations

func (c *CacheStore) GetOperations(service string) ([]string, error)

GetOperations returns all operations for a specific service traced by Jaeger

func (*CacheStore) GetServices

func (c *CacheStore) GetServices() ([]string, error)

GetServices returns all services traced by Jaeger

func (*CacheStore) Update

func (c *CacheStore) Update(service, operation string, expireTime uint64)

Update caches the results of service and service + operation indexes and maintains their TTL

type SpanWriter

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

SpanWriter for writing spans to badger

func NewSpanWriter

func NewSpanWriter(db *badger.DB, c *CacheStore, ttl time.Duration, storageCloser io.Closer) *SpanWriter

NewSpanWriter returns a SpawnWriter with cache

func (*SpanWriter) Close

func (w *SpanWriter) Close() error

Close Implements io.Closer and closes the underlying storage

func (*SpanWriter) WriteSpan

func (w *SpanWriter) WriteSpan(span *model.Span) error

WriteSpan writes the encoded span as well as creates indexes with defined TTL

type TraceReader

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

TraceReader reads traces from the local badger store

func NewTraceReader

func NewTraceReader(db *badger.DB, c *CacheStore) *TraceReader

NewTraceReader returns a TraceReader with cache

func (*TraceReader) FindTraceIDs

func (r *TraceReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error)

FindTraceIDs retrieves only the TraceIDs that match the traceQuery, but not the trace data

func (*TraceReader) FindTraces

func (r *TraceReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error)

FindTraces retrieves traces that match the traceQuery

func (*TraceReader) GetOperations

func (r *TraceReader) GetOperations(ctx context.Context, service string) ([]string, error)

GetOperations fetches operations in the service and empty slice if service does not exists

func (*TraceReader) GetServices

func (r *TraceReader) GetServices(ctx context.Context) ([]string, error)

GetServices fetches the sorted service list that have not expired

func (*TraceReader) GetTrace

func (r *TraceReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

GetTrace takes a traceID and returns a Trace associated with that traceID

Jump to

Keyboard shortcuts

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