Documentation ¶
Index ¶
- func AssertContainNotTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, ...) bool
- func AssertContainTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, ...) bool
- func AssertHasNotTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, ...) bool
- func AssertHasTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, ...) bool
- type DefaultTestTraceExporter
- func (e *DefaultTestTraceExporter) ContainSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool
- func (e *DefaultTestTraceExporter) Dump()
- func (e *DefaultTestTraceExporter) Exporter() trace.SpanExporter
- func (e *DefaultTestTraceExporter) HasSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool
- func (e *DefaultTestTraceExporter) Reset() TestTraceExporter
- func (e *DefaultTestTraceExporter) Span(name string) (tracetest.SpanStub, error)
- func (e *DefaultTestTraceExporter) Spans() tracetest.SpanStubs
- type TestTraceExporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContainNotTraceSpan ¶
func AssertContainNotTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, expectedAttributes ...attribute.KeyValue) bool
AssertContainNotTraceSpan allows to assert if a trace span partially matching provided name and attributes cannot be found.
func AssertContainTraceSpan ¶
func AssertContainTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, expectedAttributes ...attribute.KeyValue) bool
AssertContainTraceSpan allows to assert if a trace span partially matching provided name and attributes can be found.
func AssertHasNotTraceSpan ¶
func AssertHasNotTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, expectedAttributes ...attribute.KeyValue) bool
AssertHasNotTraceSpan allows to assert if a trace span exactly matching provided name and attributes cannot be found.
func AssertHasTraceSpan ¶
func AssertHasTraceSpan(tb testing.TB, exporter TestTraceExporter, expectedName string, expectedAttributes ...attribute.KeyValue) bool
AssertHasTraceSpan allows to assert if a trace span exactly matching provided name and attributes can be found.
Types ¶
type DefaultTestTraceExporter ¶
type DefaultTestTraceExporter struct {
*tracetest.InMemoryExporter
}
DefaultTestTraceExporter is the default TestTraceExporter implementation.
func (*DefaultTestTraceExporter) ContainSpan ¶
func (e *DefaultTestTraceExporter) ContainSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool
ContainSpan return true if a trace span from the in memory internal buffer is partially matching provided name and attributes.
func (*DefaultTestTraceExporter) Dump ¶ added in v1.1.0
func (e *DefaultTestTraceExporter) Dump()
Dump prints the tracetest.SpanStubs snapshots from the in memory internal exporter, for debugging purposes.
func (*DefaultTestTraceExporter) Exporter ¶
func (e *DefaultTestTraceExporter) Exporter() trace.SpanExporter
Exporter returns the in memory internal exporter.
func (*DefaultTestTraceExporter) HasSpan ¶
func (e *DefaultTestTraceExporter) HasSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool
HasSpan return true if a trace span from the in memory internal buffer is exactly matching provided name and attributes.
func (*DefaultTestTraceExporter) Reset ¶
func (e *DefaultTestTraceExporter) Reset() TestTraceExporter
Reset resets the in memory internal exporter.
func (*DefaultTestTraceExporter) Span ¶
func (e *DefaultTestTraceExporter) Span(name string) (tracetest.SpanStub, error)
Span get a specific tracetest.SpanStub from the in memory internal exporter by name.
func (*DefaultTestTraceExporter) Spans ¶
func (e *DefaultTestTraceExporter) Spans() tracetest.SpanStubs
Spans get the tracetest.SpanStubs from the in memory internal exporter.
type TestTraceExporter ¶
type TestTraceExporter interface { trace.SpanExporter Exporter() trace.SpanExporter Reset() TestTraceExporter Spans() tracetest.SpanStubs Span(name string) (tracetest.SpanStub, error) HasSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool ContainSpan(expectedName string, expectedAttributes ...attribute.KeyValue) bool Dump() }
TestTraceExporter is the interface for test trace span exporters.
func NewDefaultTestTraceExporter ¶
func NewDefaultTestTraceExporter() TestTraceExporter
NewDefaultTestTraceExporter returns a DefaultTestTraceExporter, implementing TestTraceExporter.