store

package
v1.0.0-3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLogs

func DecodeLogs(raw []byte) ([]model.Log, error)

func DecodeSpanID

func DecodeSpanID(raw []byte) model.SpanID

DecodeSpanID decodes a span id form a byte slice.

func DecodeSpanRefs added in v0.3.0

func DecodeSpanRefs(data []byte) ([]model.SpanRef, error)

func DecodeTags

func DecodeTags(input []byte) ([]model.KeyValue, error)

func DecodeTraceID

func DecodeTraceID(raw []byte) model.TraceID

DecodeTraceID converts a slice of raw bytes into a trace id.

func EncodeInterval

func EncodeInterval(duration time.Duration) pgtype.Interval

func EncodeLogs

func EncodeLogs(logs []model.Log) ([]byte, error)

func EncodeSpanID

func EncodeSpanID(spanID model.SpanID) []byte

EncodeSpanID encodes a span id into a slice of bytes.

func EncodeSpanKind

func EncodeSpanKind(modelKind trace.SpanKind) sql.Spankind

func EncodeSpanRefs added in v0.3.0

func EncodeSpanRefs(spanrefs []model.SpanRef) ([]byte, error)

func EncodeTags

func EncodeTags(input []model.KeyValue) ([]byte, error)

func EncodeTimestamp

func EncodeTimestamp(t time.Time) pgtype.Timestamp

func EncodeTraceID

func EncodeTraceID(traceID model.TraceID) []byte

EncodeTraceID converts a trace id to a slice of raw bytes.

func TruncateTime added in v0.3.0

func TruncateTime(ts time.Time) time.Time

Types

type InstrumentedReader added in v1.0.0

type InstrumentedReader struct {
	spanstore.Reader
	// contains filtered or unexported fields
}

InstrumentedReader is a reader that has been instrumented.

func NewInstrumentedReader added in v1.0.0

func NewInstrumentedReader(embedded spanstore.Reader, logger *slog.Logger) *InstrumentedReader

NewInstrumentedReader returns a new spanstore.Reader that is instrumented.

func (*InstrumentedReader) FindTraceIDs added in v1.0.0

FindTraceIDs retrieve traceIDs that match the traceQuery

func (*InstrumentedReader) FindTraces added in v1.0.0

FindTraces retrieve traces that match the traceQuery

func (*InstrumentedReader) GetTrace added in v1.0.0

func (r *InstrumentedReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

GetTrace takes a traceID and returns a Trace associated with that traceID

type InstrumentedWriter added in v1.0.0

type InstrumentedWriter struct {
	spanstore.Writer
	// contains filtered or unexported fields
}

InstrumentedWriter is a writer that has been instrumented.

func NewInstrumentedWriter added in v1.0.0

func NewInstrumentedWriter(embedded spanstore.Writer, logger *slog.Logger) *InstrumentedWriter

NewInstrumentedWriter returns a new spanstore.Writer that is instrumented.

func (InstrumentedWriter) WriteSpan added in v1.0.0

func (w InstrumentedWriter) WriteSpan(ctx context.Context, span *model.Span) error

type Reader

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

Reader can query for and load traces from PostgreSQL v2.x.

func NewReader

func NewReader(q *sql.Queries, logger *slog.Logger) *Reader

NewReader returns a new SpanReader for PostgreSQL v2.x.

func (*Reader) FindTraceIDs

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

FindTraceIDs retrieve traceIDs that match the traceQuery

func (*Reader) FindTraces

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

FindTraces retrieve traces that match the traceQuery

func (*Reader) GetDependencies

func (r *Reader) GetDependencies(ctx context.Context, endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error)

GetDependencies returns all inter-service dependencies

func (*Reader) GetOperations

GetOperations returns all operations for a specific service traced by Jaeger

func (*Reader) GetServices

func (r *Reader) GetServices(ctx context.Context) ([]string, error)

GetServices returns all services traced by Jaeger

func (*Reader) GetTrace

func (r *Reader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)

GetTrace takes a traceID and returns a Trace associated with that traceID

type Writer

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

Writer handles all writes to PostgreSQL 2.x for the Jaeger data model

func NewWriter

func NewWriter(q *sql.Queries, logger *slog.Logger) *Writer

NewWriter returns a Writer.

func (*Writer) Close

func (w *Writer) Close() error

Close triggers a graceful shutdown

func (*Writer) WriteSpan

func (w *Writer) WriteSpan(ctx context.Context, span *model.Span) error

WriteSpan saves the span into PostgreSQL

Jump to

Keyboard shortcuts

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