tracing

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyPrintTrace

func PrettyPrintTrace(trace []model.SpanModel) string

PrettyPrintTrace pretty prints a Trace.

func Setup

func Setup(t *testing.T, client *lib.Client)

Setup sets up port forwarding to Zipkin and sets the knative-eventing tracing config to debug mode (everything is sampled).

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]string `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) Cmp added in v0.14.0

func (m *SpanMatcher) Cmp(m2 *SpanMatcher) int

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

type SpanTree struct {
	Root     bool
	Span     model.SpanModel
	Children []SpanTree
}

SpanTree is the tree of Spans representation of a Trace.

func GetTraceTree

func GetTraceTree(trace []model.SpanModel) (*SpanTree, error)

GetTraceTree converts a set slice of spans into a SpanTree.

func (SpanTree) String

func (t SpanTree) String() string

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

Jump to

Keyboard shortcuts

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