Help us shape the future of Go! Take the 2026 Go Developer Survey

spanstore

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: Apache-2.0 Imports: 20 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")

	// 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")
)

Functions

func NewSpanReader

func NewSpanReader(p SpanReaderParams) spanstore.Reader

NewSpanReader returns a new SpanReader with a metrics.

Types

type ServiceOperationStorage added in v0.5.2

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

ServiceOperationStorage stores service to operation pairs.

func NewServiceOperationStorage added in v0.5.2

func NewServiceOperationStorage(
	ctx context.Context,
	client es.Client,
	logger *zap.Logger,
	cacheTTL time.Duration,
) *ServiceOperationStorage

NewServiceOperationStorage returns a new ServiceOperationStorage.

func (*ServiceOperationStorage) Write added in v0.5.2

func (s *ServiceOperationStorage) Write(indexName string, jsonSpan *dbmodel.Span)

Write saves a service to operation pair.

type SpanReader

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

SpanReader can query for and load traces from ElasticSearch

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

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

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, ordered by frequency

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

type SpanReaderParams struct {
	Client         es.Client
	Logger         *zap.Logger
	MaxSpanAge     time.Duration
	MetricsFactory metrics.Factory

	IndexPrefix       string
	TagDotReplacement string
	// contains filtered or unexported fields
}

SpanReaderParams holds constructor params for NewSpanReader

type SpanWriter

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

SpanWriter is a wrapper around elastic.Client

func NewSpanWriter

func NewSpanWriter(p SpanWriterParams) *SpanWriter

NewSpanWriter creates a new SpanWriter for use

func (*SpanWriter) Close added in v1.2.0

func (s *SpanWriter) Close() error

Close closes SpanWriter

func (*SpanWriter) WriteSpan

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

WriteSpan writes a span and its corresponding service:operation in ElasticSearch

type SpanWriterParams added in v1.7.0

type SpanWriterParams struct {
	Client            es.Client
	Logger            *zap.Logger
	MetricsFactory    metrics.Factory
	NumShards         int64
	NumReplicas       int64
	IndexPrefix       string
	AllTagsAsFields   bool
	TagKeysAsFields   []string
	TagDotReplacement string
}

SpanWriterParams holds constructor parameters for NewSpanWriter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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