spanstore

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTraceNotFound = spanstore_v1.ErrTraceNotFound

ErrTraceNotFound is returned by Reader's GetTrace if no data is found for given trace ID.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	storage_v2.FactoryBase

	// CreateTraceReader creates a spanstore.Reader.
	CreateTraceReader() (Reader, error)

	// CreateTraceWriter creates a spanstore.Writer.
	CreateTraceWriter() (Writer, error)
}

Factory defines an interface for a factory that can create implementations of different span storage components.

type Operation

type Operation struct {
	Name     string
	SpanKind string
}

Operation contains operation name and span kind

type OperationQueryParameters

type OperationQueryParameters struct {
	ServiceName string
	SpanKind    string
}

OperationQueryParameters contains parameters of query operations, empty spanKind means get operations for all kinds of span.

type Reader

type Reader interface {
	// GetTrace retrieves the trace with a given id.
	//
	// If no spans are stored for this trace, it returns ErrTraceNotFound.
	GetTrace(ctx context.Context, traceID pcommon.TraceID) (ptrace.Traces, error)

	// GetServices returns all service names known to the backend from spans
	// within its retention period.
	GetServices(ctx context.Context) ([]string, error)

	// GetOperations returns all operation names for a given service
	// known to the backend from spans within its retention period.
	GetOperations(ctx context.Context, query OperationQueryParameters) ([]Operation, error)

	// FindTraces returns all traces matching query parameters. There's currently
	// an implementation-dependent ambiguity whether all query filters (such as
	// multiple tags) must apply to the same span within a trace, or can be satisfied
	// by different spans.
	//
	// If no matching traces are found, the function returns (nil, nil).
	FindTraces(ctx context.Context, query TraceQueryParameters) ([]ptrace.Traces, error)

	// FindTraceIDs does the same search as FindTraces, but returns only the list
	// of matching trace IDs.
	//
	// If no matching traces are found, the function returns (nil, nil).
	FindTraceIDs(ctx context.Context, query TraceQueryParameters) ([]pcommon.TraceID, error)
}

Reader finds and loads traces and other data from storage.

type TraceQueryParameters

type TraceQueryParameters struct {
	ServiceName   string
	OperationName string
	Tags          map[string]string
	StartTimeMin  time.Time
	StartTimeMax  time.Time
	DurationMin   time.Duration
	DurationMax   time.Duration
	NumTraces     int
}

TraceQueryParameters contains parameters of a trace query.

type Writer

type Writer interface {
	// WriteTrace writes a batch of spans to storage. Idempotent.
	// Implementations are not required to support atomic transactions,
	// so if any of the spans fail to be written an error is returned.
	// Compatible with OTLP Exporter API.
	WriteTraces(ctx context.Context, td ptrace.Traces) error
}

Writer writes spans to storage.

Jump to

Keyboard shortcuts

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