trace

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBatchSize    = 1000                   // this is soft limit as we might produce bigger batches in some cases
	DefaultBatchTimeout = 100 * time.Millisecond // we should aways aim at reaching size limits, not timeout
)

Variables

View Source
var (
	DefaultBatchWorkers = runtime.GOMAXPROCS(0) // package go.uber.org/automaxprocs updates this value on start
)

Functions

func ByteArrayToInt64

func ByteArrayToInt64(buf [8]byte) int64

func Int64ToByteArray

func Int64ToByteArray(x int64) [8]byte

func NewWriter

func NewWriter(conn pgxconn.PgxConn) *traceWriterImpl

func RegisterTelemetryMetrics

func RegisterTelemetryMetrics(t telemetry.Engine) error

func TraceIDToUUID

func TraceIDToUUID(buf [16]byte) pgtype.UUID

Types

type Batch

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

Batch individual insertTracesReq.

func NewBatch

func NewBatch(maxBatchSize int) *Batch

type Batcher

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

Batcher batches trace requests and sends batches to batch writer. This is done to achieve better ingest performance especially b/c Jaeger collector sends traces one by one.

func NewBatcher

func NewBatcher(config BatcherConfig, writer Writer) *Batcher

func (*Batcher) Run

func (b *Batcher) Run()

func (*Batcher) Stop

func (b *Batcher) Stop()

type BatcherConfig

type BatcherConfig struct {
	Batchers     int
	Writers      int
	MaxBatchSize int
	BatchTimeout time.Duration
}

type Dispatcher

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

Dispatcher manages trace batcher and ingestion Dispatches user request which are combined into batches later on

func NewDispatcher

func NewDispatcher(writer Writer, async bool, batchConfig BatcherConfig) *Dispatcher

func (*Dispatcher) Close

func (td *Dispatcher) Close()

func (*Dispatcher) InsertTraces

func (td *Dispatcher) InsertTraces(ctx context.Context, traces ptrace.Traces) (err error)

type TagType

type TagType uint
const (
	SpanTagType TagType = 1 << iota
	ResourceTagType
	EventTagType
	LinkTagType
)

type Writer

type Writer interface {
	InsertTraces(ctx context.Context, traces ptrace.Traces) error
	Close()
}

Jump to

Keyboard shortcuts

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