Documentation ¶
Index ¶
- Constants
- func CombineSearchResults(existing *tempopb.TraceSearchMetadata, incoming *tempopb.TraceSearchMetadata)
- func GetSearchResultFromData(s *tempofb.SearchEntry) *tempopb.TraceSearchMetadata
- func GetVirtualTagValues(tagName string) []string
- func GetVirtualTags() []string
- func NewBackendSearchBlock(input *StreamingSearchBlock, rw backend.Writer, blockID uuid.UUID, ...) error
- func WriteSearchBlockMeta(ctx context.Context, w backend.Writer, blockID uuid.UUID, tenantID string, ...) error
- type BackendSearchBlock
- func (s *BackendSearchBlock) BlockID() uuid.UUID
- func (s *BackendSearchBlock) Search(ctx context.Context, p Pipeline, sr *Results) error
- func (s *BackendSearchBlock) TagValues(ctx context.Context, tagName string, cb tagCallback) error
- func (s *BackendSearchBlock) Tags(ctx context.Context, cb tagCallback) error
- type BlockMeta
- type DataCombiner
- type Pipeline
- type Results
- func (sr *Results) AddBlockInspected()
- func (sr *Results) AddBlockSkipped()
- func (sr *Results) AddBytesInspected(c uint64)
- func (sr *Results) AddResult(ctx context.Context, r *tempopb.TraceSearchMetadata) (quit bool)
- func (sr *Results) AddTraceInspected(c uint32)
- func (sr *Results) AllWorkersStarted()
- func (sr *Results) BlocksInspected() uint32
- func (sr *Results) BlocksSkipped() uint32
- func (sr *Results) BytesInspected() uint64
- func (sr *Results) Close()
- func (sr *Results) FinishWorker()
- func (sr *Results) Quit() bool
- func (sr *Results) Results() <-chan *tempopb.TraceSearchMetadata
- func (sr *Results) StartWorker()
- func (sr *Results) TracesInspected() uint32
- type SearchableBlock
- type StreamingSearchBlock
- func (s *StreamingSearchBlock) Append(ctx context.Context, id common.ID, searchData [][]byte) error
- func (s *StreamingSearchBlock) BlockID() uuid.UUID
- func (s *StreamingSearchBlock) Clear() error
- func (s *StreamingSearchBlock) Close() error
- func (s *StreamingSearchBlock) Iterator() (common.Iterator, error)
- func (s *StreamingSearchBlock) Search(ctx context.Context, p Pipeline, sr *Results) error
- func (s *StreamingSearchBlock) TagValues(_ context.Context, tagName string, cb tagCallback) error
- func (s *StreamingSearchBlock) Tags(_ context.Context, cb tagCallback) error
Constants ¶
const SecretExhaustiveSearchTag = "x-dbg-exhaustive"
Variables ¶
This section is empty.
Functions ¶
func CombineSearchResults ¶
func CombineSearchResults(existing *tempopb.TraceSearchMetadata, incoming *tempopb.TraceSearchMetadata)
CombineResults overlays the incoming search result with the existing result. This is required for the following reason: a trace may be present in multiple blocks, or in partial segments in live traces. The results should reflect elements of all segments.
func GetSearchResultFromData ¶
func GetSearchResultFromData(s *tempofb.SearchEntry) *tempopb.TraceSearchMetadata
func GetVirtualTagValues ¶
func GetVirtualTags ¶
func GetVirtualTags() []string
func NewBackendSearchBlock ¶
func NewBackendSearchBlock(input *StreamingSearchBlock, rw backend.Writer, blockID uuid.UUID, tenantID string, enc backend.Encoding, pageSizeBytes int) error
NewBackendSearchBlock iterates through the given WAL search data and writes it to the persistent backend in a more efficient paged form. Multiple traces are written in the same page to make sure of the flatbuffer CreateSharedString feature which dedupes strings across the entire buffer.
Types ¶
type BackendSearchBlock ¶
type BackendSearchBlock struct {
// contains filtered or unexported fields
}
func OpenBackendSearchBlock ¶
func OpenBackendSearchBlock(blockID uuid.UUID, tenantID string, r backend.Reader) *BackendSearchBlock
OpenBackendSearchBlock opens the search data for an existing block in the given backend.
func (*BackendSearchBlock) BlockID ¶
func (s *BackendSearchBlock) BlockID() uuid.UUID
BlockID provides access to the private field id
type BlockMeta ¶
type DataCombiner ¶
type DataCombiner struct{}
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func NewSearchPipeline ¶
func NewSearchPipeline(req *tempopb.SearchRequest) Pipeline
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results eases performing a highly parallel search by funneling all results into a single channel that is easy to consume, signaling workers to quit early as needed, and collecting metrics.
func NewResults ¶
func NewResults() *Results
func (*Results) AddBlockInspected ¶
func (sr *Results) AddBlockInspected()
func (*Results) AddBlockSkipped ¶
func (sr *Results) AddBlockSkipped()
func (*Results) AddBytesInspected ¶
func (*Results) AddResult ¶
AddResult sends a search result from a search task (goroutine) to the receiver of the the search results, i.e. the initiator of the search. This function blocks until there is buffer space in the results channel or if the task should stop searching because the receiver went away or the given context is done. In this case true is returned.
func (*Results) AddTraceInspected ¶
func (*Results) AllWorkersStarted ¶
func (sr *Results) AllWorkersStarted()
AllWorkersStarted indicates that no more workers (senders) will be launched, and the results channel can be closed once the number of workers reaches zero. This function call occurs after all calls to StartWorker.
func (*Results) BlocksInspected ¶
func (*Results) BlocksSkipped ¶
func (*Results) BytesInspected ¶
func (*Results) Close ¶
func (sr *Results) Close()
Close signals to all workers to quit, when max results is received and no more work is needed. Called by the initiator of the search in a defer statement like:
sr := NewSearchResults() defer sr.Close()
func (*Results) FinishWorker ¶
func (sr *Results) FinishWorker()
FinishWorker indicates a sender (goroutine) is done searching and will not send any more search results. When the last sender is finished, the results channel is closed.
func (*Results) Quit ¶
Quit returns if search tasks should quit early. This can occur due to max results already found, or other errors such as timeout, etc.
func (*Results) Results ¶
func (sr *Results) Results() <-chan *tempopb.TraceSearchMetadata
Results returns the results channel. Channel is closed when the search is complete. Can be iterated by range like:
for res := range sr.Results()
func (*Results) StartWorker ¶
func (sr *Results) StartWorker()
StartWorker indicates another sender will be using the results channel. Must be followed with a call to FinishWorker which is usually deferred in a goroutine:
sr.StartWorker() go func() { defer sr.FinishWorker()
func (*Results) TracesInspected ¶
type SearchableBlock ¶
type StreamingSearchBlock ¶
type StreamingSearchBlock struct {
// contains filtered or unexported fields
}
StreamingSearchBlock is search data that is read/write, i.e. for traces in the WAL.
func NewStreamingSearchBlockForFile ¶
func NewStreamingSearchBlockForFile(f *os.File, blockID uuid.UUID, enc backend.Encoding) (*StreamingSearchBlock, error)
NewStreamingSearchBlockForFile creates a new streaming block that will read/write the given file. File must be opened for read/write permissions.
func RescanBlocks ¶
func RescanBlocks(walPath string) ([]*StreamingSearchBlock, error)
RescanBlocks scans through the search directory in the WAL folder and replays files todo: copied from wal.RescanBlocks(), see if we can reduce duplication?
func (*StreamingSearchBlock) Append ¶
Append the given search data to the streaming block. Multiple byte buffers of search data for the same trace can be passed and are merged into one entry.
func (*StreamingSearchBlock) BlockID ¶
func (s *StreamingSearchBlock) BlockID() uuid.UUID
BlockID provides access to the private field blockID
func (*StreamingSearchBlock) Clear ¶
func (s *StreamingSearchBlock) Clear() error
Clear deletes the files for this block.
func (*StreamingSearchBlock) Close ¶
func (s *StreamingSearchBlock) Close() error
Close closes the WAL file. Used in tests
func (*StreamingSearchBlock) Iterator ¶
func (s *StreamingSearchBlock) Iterator() (common.Iterator, error)