Documentation
¶
Index ¶
- type InMemoryExporter
- func (e *InMemoryExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
- func (e *InMemoryExporter) GetSpanByName(name string) (sdktrace.ReadOnlySpan, bool)
- func (e *InMemoryExporter) GetSpans() []sdktrace.ReadOnlySpan
- func (e *InMemoryExporter) Reset()
- func (e *InMemoryExporter) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryExporter ¶
type InMemoryExporter struct {
// contains filtered or unexported fields
}
InMemoryExporter is a span exporter that stores spans in memory for testing.
func NewInMemoryExporter ¶
func NewInMemoryExporter() *InMemoryExporter
NewInMemoryExporter creates a new in-memory exporter.
func SetupTest ¶
func SetupTest(t interface{ Helper() }) (*InMemoryExporter, func())
SetupTest initializes a test tracer provider with an in-memory exporter. Returns the exporter and a cleanup function.
func (*InMemoryExporter) ExportSpans ¶
func (e *InMemoryExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
ExportSpans stores spans in memory.
func (*InMemoryExporter) GetSpanByName ¶
func (e *InMemoryExporter) GetSpanByName(name string) (sdktrace.ReadOnlySpan, bool)
GetSpanByName returns the first span with the given name.
func (*InMemoryExporter) GetSpans ¶
func (e *InMemoryExporter) GetSpans() []sdktrace.ReadOnlySpan
GetSpans returns all exported spans.
Click to show internal directories.
Click to hide internal directories.