v1adapter

package
v1.65.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Storage Factory Converter

A temporary v1 storage factory wrapper to implement v2 storage APIs. This way, the existing v1 storage factories declared in jaegerstorageextension can act as v2 storage while we migrate to v2 storage APIs.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrV1ReaderNotAvailable = errors.New("spanstore.Reader is not a wrapper around v1 reader")

Functions

func GetV1Reader

func GetV1Reader(reader tracestore.Reader) (spanstore.Reader, error)

func InitializeArchiveStorage

func InitializeArchiveStorage(
	storageFactory storage.BaseFactory,
	logger *zap.Logger,
) (*TraceReader, *TraceWriter)

func ProtoFromTraces

func ProtoFromTraces(traces ptrace.Traces) []*model.Batch

ProtoFromTraces converts OpenTelemetry traces (ptrace.Traces) to Jaeger model batches ([]*model.Batch).

TODO remove this function in favor of V1BatchesFromTraces

func V1BatchesFromTraces

func V1BatchesFromTraces(traces ptrace.Traces) []*model.Batch

V1BatchesFromTraces converts OpenTelemetry traces (ptrace.Traces) to Jaeger model batches ([]*model.Batch).

func V1BatchesToTraces

func V1BatchesToTraces(batches []*model.Batch) ptrace.Traces

V1BatchesToTraces converts Jaeger model batches ([]*model.Batch) to OpenTelemetry traces (ptrace.Traces).

func V1TraceIDsFromSeq2

func V1TraceIDsFromSeq2(traceIDsIter iter.Seq2[[]pcommon.TraceID, error]) ([]model.TraceID, error)

func V1TraceToOtelTrace

func V1TraceToOtelTrace(jTrace *model.Trace) ptrace.Traces

V1TraceToOtelTrace converts v1 traces (*model.Trace) to Otel traces (ptrace.Traces)

func V1TracesFromSeq2

func V1TracesFromSeq2(otelSeq iter.Seq2[[]ptrace.Traces, error]) ([]*model.Trace, error)

V1TracesFromSeq2 converts an interator of ptrace.Traces chunks into v1 traces.

Types

type DependencyReader

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

func NewDependencyReader

func NewDependencyReader(reader dependencystore.Reader) *DependencyReader

func (*DependencyReader) GetDependencies

func (dr *DependencyReader) GetDependencies(
	ctx context.Context,
	query depstore.QueryParameters,
) ([]model.DependencyLink, error)

type Factory

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

func NewFactory

func NewFactory(ss storage_v1.Factory) *Factory

func (*Factory) Close

func (f *Factory) Close(_ context.Context) error

Close implements tracestore.Factory.

func (*Factory) CreateDependencyReader

func (f *Factory) CreateDependencyReader() (depstore.Reader, error)

CreateDependencyReader implements depstore.Factory.

func (*Factory) CreateTraceReader

func (f *Factory) CreateTraceReader() (tracestore.Reader, error)

CreateTraceReader implements tracestore.Factory.

func (*Factory) CreateTraceWriter

func (f *Factory) CreateTraceWriter() (tracestore.Writer, error)

CreateTraceWriter implements tracestore.Factory.

func (*Factory) Initialize

func (*Factory) Initialize(_ context.Context) error

Initialize implements tracestore.Factory.

type SpanReader

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

SpanReader wraps a tracestore.Reader so that it can be downgraded to implement the v1 spanstore.Reader interface.

func NewSpanReader

func NewSpanReader(traceReader tracestore.Reader) *SpanReader

func (*SpanReader) FindTraceIDs

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

func (*SpanReader) FindTraces

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

func (*SpanReader) GetOperations

func (sr *SpanReader) GetOperations(
	ctx context.Context,
	query spanstore.OperationQueryParameters,
) ([]spanstore.Operation, error)

func (*SpanReader) GetServices

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

func (*SpanReader) GetTrace

func (sr *SpanReader) GetTrace(ctx context.Context, query spanstore.GetTraceParameters) (*model.Trace, error)

type TraceReader

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

func NewTraceReader

func NewTraceReader(spanReader spanstore.Reader) *TraceReader

func (*TraceReader) FindTraceIDs

func (tr *TraceReader) FindTraceIDs(
	ctx context.Context,
	query tracestore.TraceQueryParams,
) iter.Seq2[[]pcommon.TraceID, error]

func (*TraceReader) FindTraces

func (tr *TraceReader) FindTraces(
	ctx context.Context,
	query tracestore.TraceQueryParams,
) iter.Seq2[[]ptrace.Traces, error]

func (*TraceReader) GetOperations

func (tr *TraceReader) GetOperations(
	ctx context.Context,
	query tracestore.OperationQueryParams,
) ([]tracestore.Operation, error)

func (*TraceReader) GetServices

func (tr *TraceReader) GetServices(ctx context.Context) ([]string, error)

func (*TraceReader) GetTraces

func (tr *TraceReader) GetTraces(
	ctx context.Context,
	traceIDs ...tracestore.GetTraceParams,
) iter.Seq2[[]ptrace.Traces, error]

type TraceWriter

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

func NewTraceWriter

func NewTraceWriter(spanWriter spanstore.Writer) *TraceWriter

func (*TraceWriter) WriteTraces

func (t *TraceWriter) WriteTraces(ctx context.Context, td ptrace.Traces) error

WriteTraces implements tracestore.Writer.

Jump to

Keyboard shortcuts

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