spanstore

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationWithPrefix = "OperationWithPrefix"
	Tags                = "Tags"
)

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

Functions

func FromSpan

func FromSpan(span *model.Span, topic, source string, rules TagAppendRules) (*sls.LogGroup, error)

FromSpan converts a model.Span to a log record

func InitSpanWriterLogstoreResource

func InitSpanWriterLogstoreResource(client sls.ClientInterface, project string, logstore string, logger *zap.Logger) error

InitSpanWriterLogstoreResource create project, logstore, index, dashboard for jeager collector

func NewSpanReader

func NewSpanReader(client sls.ClientInterface,
	project string,
	logstore string,
	aggLogstore string,
	logger *zap.Logger,
	maxLookback time.Duration,
	metricsFactory metrics.Factory) spanstore.Reader

NewSpanReader returns a new SpanReader with a metrics.

func ToSpan

func ToSpan(log map[string]string) (*model.Span, error)

ToSpan converts a log record to a model.Span

func ToTraces

func ToTraces(logs []map[string]string) ([]*model.Trace, error)

ToTraces converts logs to []*model.Trace

Types

type SpanReader

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

SpanReader can query for and load traces from AliCloud Log Service

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
}

func NewSpanWriter

func NewSpanWriter(client sls.ClientInterface, project string, logstore string, initResourceFlag bool, logger *zap.Logger, metricsFactory metrics.Factory, tagAppendRule string) (*SpanWriter, error)

func (*SpanWriter) Close

func (s *SpanWriter) Close() error

func (*SpanWriter) WriteSpan

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

type TagAppendRules

type TagAppendRules interface {
	SpanTagRules() map[string]*TagMappingValue
	OperationPrefixRules() map[string]*TagMappingValue
}

type TagMappingValue

type TagMappingValue struct {
	TagKey   string
	TagValue string
}

Jump to

Keyboard shortcuts

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