Documentation ¶
Index ¶
- type Encoding
- type SpanWriter
- type TableName
- type TraceReader
- func (r *TraceReader) FindTraceIDs(ctx context.Context, params *spanstore.TraceQueryParameters) ([]model.TraceID, error)
- func (r *TraceReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error)
- func (r *TraceReader) GetOperations(ctx context.Context, params spanstore.OperationQueryParameters) ([]spanstore.Operation, error)
- func (r *TraceReader) GetServices(ctx context.Context) ([]string, error)
- func (r *TraceReader) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error)
- type WorkerParams
- type WriteWorker
- type WriteWorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpanWriter ¶
type SpanWriter struct {
// contains filtered or unexported fields
}
SpanWriter for writing spans to ClickHouse
func NewSpanWriter ¶
func NewSpanWriter( logger hclog.Logger, db *sql.DB, indexTable, spansTable TableName, tenant string, encoding Encoding, delay time.Duration, size int64, maxSpanCount int, ) *SpanWriter
NewSpanWriter returns a SpanWriter for the database
func (*SpanWriter) Close ¶
func (w *SpanWriter) Close() error
Close Implements io.Closer and closes the underlying storage
type TraceReader ¶
type TraceReader struct {
// contains filtered or unexported fields
}
TraceReader for reading spans from ClickHouse
func NewTraceReader ¶
func NewTraceReader(db *sql.DB, operationsTable, indexTable, spansTable TableName, tenant string, maxNumSpans uint) *TraceReader
NewTraceReader returns a TraceReader for the database
func (*TraceReader) FindTraceIDs ¶
func (r *TraceReader) FindTraceIDs(ctx context.Context, params *spanstore.TraceQueryParameters) ([]model.TraceID, error)
FindTraceIDs retrieves only the TraceIDs that match the traceQuery, but not the trace data
func (*TraceReader) FindTraces ¶
func (r *TraceReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error)
FindTraces retrieves traces that match the traceQuery
func (*TraceReader) GetOperations ¶
func (r *TraceReader) GetOperations( ctx context.Context, params spanstore.OperationQueryParameters, ) ([]spanstore.Operation, error)
GetOperations fetches operations in the service and empty slice if service does not exists
func (*TraceReader) GetServices ¶
func (r *TraceReader) GetServices(ctx context.Context) ([]string, error)
GetServices fetches the sorted service list that have not expired
type WorkerParams ¶
type WorkerParams struct {
// contains filtered or unexported fields
}
WorkerParams contains parameters that are shared between WriteWorkers
type WriteWorker ¶
type WriteWorker struct {
// contains filtered or unexported fields
}
WriteWorker writes spans to CLickHouse. Given a batch of spans, WriteWorker attempts to write them to database. Interval in seconds between attempts changes due to delays slice, then it remains the same as the last value in delays.
func (*WriteWorker) Close ¶
func (worker *WriteWorker) Close()
func (*WriteWorker) Work ¶
func (worker *WriteWorker) Work()
type WriteWorkerPool ¶
type WriteWorkerPool struct {
// contains filtered or unexported fields
}
WriteWorkerPool is a worker pool for writing batches of spans. Given a new batch, WriteWorkerPool creates a new WriteWorker. If the number of currently processed spans if more than maxSpanCount, then the oldest worker is removed.
func NewWorkerPool ¶
func NewWorkerPool(params *WorkerParams, maxSpanCount int) WriteWorkerPool
func (*WriteWorkerPool) Close ¶
func (pool *WriteWorkerPool) Close()
func (*WriteWorkerPool) Work ¶
func (pool *WriteWorkerPool) Work()
func (*WriteWorkerPool) WriteBatch ¶
func (pool *WriteWorkerPool) WriteBatch(batch []*model.Span)