spanstore

package
v1.46.0-tgt.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 18 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("start Time Minimum is above Maximum")

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

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

	// ErrDurationAndTagQueryNotSupported occurs when duration and tags are both set
	ErrDurationAndTagQueryNotSupported = errors.New("cannot query for duration and tags simultaneously")

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

Functions

This section is empty.

Types

type OperationNamesStorage

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

OperationNamesStorage stores known operation names by service.

func NewOperationNamesStorage

func NewOperationNamesStorage(
	session cassandra.Session,
	writeCacheTTL time.Duration,
	metricsFactory metrics.Factory,
	logger *zap.Logger,
) *OperationNamesStorage

NewOperationNamesStorage returns a new OperationNamesStorage

func (*OperationNamesStorage) GetOperations

GetOperations returns all operations for a specific service traced by Jaeger

func (*OperationNamesStorage) Write

func (s *OperationNamesStorage) Write(operation dbmodel.Operation) error

Write saves Operation and Service name tuples

type Option

type Option func(c *Options)

Option is a function that sets some option on the writer.

func IndexFilter

func IndexFilter(indexFilter dbmodel.IndexFilter) Option

IndexFilter can be provided to filter certain spans that should not be indexed.

func StoreIndexesOnly

func StoreIndexesOnly() Option

StoreIndexesOnly can be provided to skip storing spans, and only store span indexes.

func StoreWithoutIndexing

func StoreWithoutIndexing() Option

StoreWithoutIndexing can be provided to store spans without indexing them.

func TagFilter

func TagFilter(tagFilter dbmodel.TagFilter) Option

TagFilter can be provided to filter any tags that should not be indexed.

type Options

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

Options control behavior of the writer.

type ServiceNamesStorage

type ServiceNamesStorage struct {
	InsertStmt string
	QueryStmt  string
	// contains filtered or unexported fields
}

ServiceNamesStorage stores known service names.

func NewServiceNamesStorage

func NewServiceNamesStorage(
	session cassandra.Session,
	writeCacheTTL time.Duration,
	metricsFactory metrics.Factory,
	logger *zap.Logger,
) *ServiceNamesStorage

NewServiceNamesStorage returns a new ServiceNamesStorage

func (*ServiceNamesStorage) GetServices

func (s *ServiceNamesStorage) GetServices() ([]string, error)

GetServices returns all services traced by Jaeger

func (*ServiceNamesStorage) Write

func (s *ServiceNamesStorage) Write(serviceName string) error

Write saves a single service name

type SpanReader

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

SpanReader can query for and load traces from Cassandra.

func NewSpanReader

func NewSpanReader(
	session cassandra.Session,
	metricsFactory metrics.Factory,
	logger *zap.Logger,
) *SpanReader

NewSpanReader returns a new SpanReader.

func (*SpanReader) FindTraceIDs

func (s *SpanReader) FindTraceIDs(ctx context.Context, traceQuery *spanstore.TraceQueryParameters) ([]model.TraceID, error)

FindTraceIDs retrieve traceIDs that match the traceQuery

func (*SpanReader) FindTraces

func (s *SpanReader) FindTraces(ctx context.Context, traceQuery *spanstore.TraceQueryParameters) ([]*model.Trace, error)

FindTraces retrieves traces that match the traceQuery

func (*SpanReader) GetOperations

GetOperations returns all operations for a specific service traced by Jaeger

func (*SpanReader) GetServices

func (s *SpanReader) GetServices(ctx context.Context) ([]string, error)

GetServices returns all services traced by Jaeger

func (*SpanReader) GetTrace

func (s *SpanReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

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

type SpanWriter

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

SpanWriter handles all writes to Cassandra for the Jaeger data model

func NewSpanWriter

func NewSpanWriter(
	session cassandra.Session,
	writeCacheTTL time.Duration,
	metricsFactory metrics.Factory,
	logger *zap.Logger,
	options ...Option,
) *SpanWriter

NewSpanWriter returns a SpanWriter

func (*SpanWriter) Close

func (s *SpanWriter) Close() error

Close closes SpanWriter

func (*SpanWriter) WriteSpan

func (s *SpanWriter) WriteSpan(ctx context.Context, span *model.Span) error

WriteSpan saves the span into Cassandra

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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