Back to

Package spanstore

Latest Go to latest

The highest tagged major version is .

Published: Jun 29, 2020 | License: Apache-2.0 | Module:



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

func NewSpanReader

func NewSpanReader(client es.Client, logger *zap.Logger, maxLookback time.Duration, metricsFactory metrics.Factory) spanstore.Reader

NewSpanReader returns a new SpanReader with a metrics.

type Service

type Service struct {
	ServiceName   string `json:"serviceName"`
	OperationName string `json:"operationName"`

Service is the JSON struct for service:operation documents in ElasticSearch

type ServiceOperationStorage

type ServiceOperationStorage struct {
	// contains filtered or unexported fields

ServiceOperationStorage stores service to operation pairs.

func NewServiceOperationStorage

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

NewServiceOperationStorage returns a new ServiceOperationStorage.

func (*ServiceOperationStorage) Write

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

Write saves a service to operation pair.

type Span

type Span struct {
	StartTimeMillis uint64 `json:"startTimeMillis"`

Span adds a StartTimeMillis field to the standard JSON span. ElasticSearch does not support a UNIX Epoch timestamp in microseconds, so Jaeger maps StartTime to a 'long' type. This extra StartTimeMillis field works around this issue, enabling timerange queries.

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(traceQuery *spanstore.TraceQueryParameters) ([]*model.Trace, error)

FindTraces retrieves traces that match the traceQuery

func (*SpanReader) GetOperations

func (s *SpanReader) GetOperations(service string) ([]string, error)

GetOperations returns all operations for a specific service traced by Jaeger

func (*SpanReader) GetServices

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

GetServices returns all services traced by Jaeger, ordered by frequency

func (*SpanReader) GetTrace

func (s *SpanReader) GetTrace(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 is a wrapper around elastic.Client

func NewSpanWriter

func NewSpanWriter(
	client es.Client,
	logger *zap.Logger,
	metricsFactory metrics.Factory,
	numShards int64,
	numReplicas int64,
) *SpanWriter

NewSpanWriter creates a new SpanWriter for use

func (*SpanWriter) Close

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier