trace

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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

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

func SortTrace

func SortTrace(t *tempopb.Trace)

SortTrace sorts a *tempopb.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

func (c *Combiner) Consume(tr *tempopb.Trace) (spanCount int)

Consume the given trace and destructively combines its contents.

func (*Combiner) ConsumeWithFinal added in v1.4.0

func (c *Combiner) ConsumeWithFinal(tr *tempopb.Trace, final bool) (spanCount int)

ConsumeWithFinal consumes the trace, but allows for performance savings when it is known that this is the last expected input trace.

func (*Combiner) Result added in v1.4.0

func (c *Combiner) Result() (*tempopb.Trace, int)

Result returns the final trace and span count.

type ExtractTagFunc added in v1.5.0

type ExtractTagFunc func(tag string) bool

Jump to

Keyboard shortcuts

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