pgstore

package
v0.0.0-...-f5eb9b4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// TCP host:port or Unix socket depending on Network.
	Host     string `yaml:"host"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Configuration describes the options to customize the storage behavior

func (*Configuration) InitFromViper

func (c *Configuration) InitFromViper(v *viper.Viper)

InitFromViper initializes the options struct with values from Viper

type Log

type Log struct {
	ID uint64

	SpanID    model.SpanID
	Timestamp time.Time
	Fields    map[string]interface{}
	// contains filtered or unexported fields
}

type Operation

type Operation struct {
	ID            uint
	OperationName string `pg:",unique"`
}

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(db *pg.DB, 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) (ret []model.TraceID, err 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(endTs time.Time, lookback time.Duration) (ret []model.DependencyLink, err 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 Service

type Service struct {
	ID          uint
	ServiceName string `pg:",unique"`
}

type Span

type Span struct {
	ID          model.SpanID
	TraceIDLow  uint64
	TraceIDHigh uint64
	Operation   *Operation
	OperationID uint
	Flags       model.Flags
	StartTime   time.Time
	Duration    time.Duration
	Tags        map[string]interface{}
	Service     *Service
	ServiceID   uint
	ProcessID   string
	ProcessTags map[string]interface{}
	Warnings    []string
}

type SpanRef

type SpanRef struct {
	ID           uint64
	TraceIDLow   uint64
	TraceIDHigh  uint64
	SourceSpanID model.SpanID
	ChildSpanID  model.SpanID
	RefType      model.SpanRefType `sql:",use_zero"`
}

type Store

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

func NewStore

func NewStore(conf *Configuration, logger hclog.Logger) (*Store, func() error, error)

func (*Store) Close

func (s *Store) Close() error

Close writer and DB

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(db *pg.DB, logger hclog.Logger) *Writer

NewWriter returns a Writer for PostgreSQL v2.x

func (*Writer) Close

func (w *Writer) Close() error

Close triggers a graceful shutdown

func (*Writer) WriteSpan

func (w *Writer) WriteSpan(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