store

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 17 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 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 hclog.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 Store

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

func NewStore

func NewStore(pool *pgxpool.Pool, logger hclog.Logger) (*Store, error)

func (*Store) DependencyReader

func (s *Store) DependencyReader() dependencystore.Reader

func (*Store) SpanReader

func (s *Store) SpanReader() spanstore.Reader

func (*Store) SpanWriter

func (s *Store) SpanWriter() spanstore.Writer

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 hclog.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