Documentation
¶
Index ¶
- Constants
- Variables
- func ExtractSearchData(tr *tempopb.Trace, id []byte, extractTag ExtractTagFunc) []byte
- func MatchesProto(id []byte, trace *tempopb.Trace, req *tempopb.SearchRequest) (*tempopb.TraceSearchMetadata, error)
- func SearchTestSuite() (id []byte, tr *tempopb.Trace, start, end uint32, ...)
- func SortTrace(t *tempopb.Trace)
- type Combiner
- type ExtractTagFunc
Constants ¶
const ( RootSpanNotYetReceivedText = "<root span not yet received>" RootServiceNameTag = "root.service.name" ServiceNameTag = "service.name" RootSpanNameTag = "root.name" SpanNameTag = "name" ErrorTag = "error" StatusCodeTag = "status.code" StatusCodeUnset = "unset" StatusCodeOK = "ok" StatusCodeError = "error" )
Variables ¶
var StatusCodeMapping = map[string]int{ StatusCodeUnset: int(v1.Status_STATUS_CODE_UNSET), StatusCodeOK: int(v1.Status_STATUS_CODE_OK), StatusCodeError: int(v1.Status_STATUS_CODE_ERROR), }
Functions ¶
func ExtractSearchData ¶ added in v1.5.0
func ExtractSearchData(tr *tempopb.Trace, id []byte, extractTag ExtractTagFunc) []byte
ExtractSearchData returns the flatbuffer search data for the given trace. It is extracted here in the distributor because this is the only place on the ingest path where the trace is available in object form.
func MatchesProto ¶
func MatchesProto(id []byte, trace *tempopb.Trace, req *tempopb.SearchRequest) (*tempopb.TraceSearchMetadata, error)
func SearchTestSuite ¶ added in v1.5.0
func SearchTestSuite() ( id []byte, tr *tempopb.Trace, start, end uint32, expected *tempopb.TraceSearchMetadata, searchesThatMatch []*tempopb.SearchRequest, searchesThatDontMatch []*tempopb.SearchRequest, tagNames []string, tagValues map[string][]string, )
SearchTestSuite returns a set of search test cases that ensure search behavior is consistent across block types and modules. The return parameters are:
- trace ID
- trace - a fully-populated trace that is searched for every condition. If testing a block format, then write this trace to the block.
- start, end - the unix second start/end times for the trace, i.e. slack-adjusted timestamps
- expected - The exact search result that should be returned for every matching request
- searchesThatMatch - List of search requests that are expected to match the trace
- searchesThatDontMatch - List of requests that don't match the trace
Types ¶
type Combiner ¶ added in v1.4.0
type Combiner struct {
// contains filtered or unexported fields
}
Combiner combines multiple partial traces into one, deduping spans based on ID and kind. Note that it is destructive. There are design decisions for efficiency: * Only scan/hash the spans for each input once, which is reused across calls. * Only sort the final result once and if needed. * Don't scan/hash the spans for the last input (final=true).
func NewCombiner ¶ added in v1.4.0
func NewCombiner() *Combiner
func (*Combiner) Consume ¶ added in v1.4.0
Consume the given trace and destructively combines its contents.
func (*Combiner) ConsumeWithFinal ¶ added in v1.4.0
ConsumeWithFinal consumes the trace, but allows for performance savings when it is known that this is the last expected input trace.