Documentation
¶
Overview ¶
Package obstest holds the test doubles for Ctrl Plane's telemetry: a span recorder installed as the global tracer provider, a metrics sink that remembers every series by name and labels, and a check that sensitive values never reach a span.
Index ¶
- func AssertAbsent(t *testing.T, spans []sdktrace.ReadOnlySpan, values ...string)
- func Attrs(s sdktrace.ReadOnlySpan) map[string]string
- func Key(name string, labels map[string]string) string
- func Named(rec *tracetest.SpanRecorder, name string) []sdktrace.ReadOnlySpan
- func Record(t *testing.T) *tracetest.SpanRecorder
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAbsent ¶
func AssertAbsent(t *testing.T, spans []sdktrace.ReadOnlySpan, values ...string)
AssertAbsent fails when any of values shows up in a span's name, status description, attributes, or event names and attributes.
func Attrs ¶
func Attrs(s sdktrace.ReadOnlySpan) map[string]string
Attrs returns a span's attributes as strings, keyed by attribute name.
func Named ¶
func Named(rec *tracetest.SpanRecorder, name string) []sdktrace.ReadOnlySpan
Named returns the ended spans called name, in the order they ended.
Types ¶
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink is a go-utils metrics sink that remembers every series it hands out, keyed as name{label=value,...} with the labels sorted.
func (*Sink) Counter ¶
Counter returns the value of the counter stored under key, failing the test when there is none.
func (*Sink) Gauge ¶
Gauge returns the value of the gauge stored under key, failing the test when there is none.
func (*Sink) HistogramCount ¶
HistogramCount returns how many observations the histogram stored under key holds, failing the test when there is none.