Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyPrintTrace ¶
PrettyPrintTrace pretty prints a Trace.
Types ¶
type SpanMatcher ¶ added in v0.14.0
type SpanMatcher struct { Kind *model.Kind `json:"a_Kind,omitempty"` LocalEndpointServiceName string `json:"b_Name,omitempty"` Tags map[string]*regexp.Regexp `json:"c_Tags,omitempty"` }
func MatchHTTPSpanNoReply ¶ added in v0.14.0
func MatchHTTPSpanNoReply(kind model.Kind, opts ...SpanMatcherOption) *SpanMatcher
func MatchHTTPSpanWithCode ¶ added in v0.14.0
func MatchHTTPSpanWithCode(kind model.Kind, statusCode int, opts ...SpanMatcherOption) *SpanMatcher
func MatchHTTPSpanWithReply ¶ added in v0.14.0
func MatchHTTPSpanWithReply(kind model.Kind, opts ...SpanMatcherOption) *SpanMatcher
func (*SpanMatcher) MatchesSpan ¶ added in v0.14.0
func (m *SpanMatcher) MatchesSpan(span *model.SpanModel) error
type SpanMatcherOption ¶ added in v0.14.0
type SpanMatcherOption func(*SpanMatcher)
func WithHTTPHostAndPath ¶ added in v0.14.0
func WithHTTPHostAndPath(host, path string) SpanMatcherOption
func WithLocalEndpointServiceName ¶ added in v0.14.0
func WithLocalEndpointServiceName(s string) SpanMatcherOption
type SpanTree ¶
SpanTree is the tree of Spans representation of a Trace.
func GetTraceTree ¶
GetTraceTree converts a set slice of spans into a SpanTree.
type TestSpanTree ¶
type TestSpanTree struct { Note string `json:"a_Note,omitempty"` Span *SpanMatcher `json:"c_Span"` Children []TestSpanTree `json:"z_Children,omitempty"` }
TestSpanTree is the expected version of SpanTree used for assertions in testing.
The JSON names of the fields are weird because we want a specific order when pretty printing JSON. The JSON will be printed in alphabetical order, so we are imposing a certain order by prefixing the keys with a specific letter. The letter has no mean other than ordering.
func (TestSpanTree) MatchesSubtree ¶ added in v0.14.0
func (tt TestSpanTree) MatchesSubtree(t *testing.T, actual *SpanTree) (matches [][]SpanTree)
MatchesSubtree checks to see if this TestSpanTree matches a subtree of the actual SpanTree. It is intended to be used for assertions while testing. Returns the set of possible subtree matches with the corresponding set of unmatched siblings.
func (TestSpanTree) String ¶
func (tt TestSpanTree) String() string