Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCollector ¶
type MemoryCollector struct {
ctrace.UnimplementedTraceServiceServer
// contains filtered or unexported fields
}
MemoryCollector is a gRPC-based OTEL collector that collects spans in memory.
func StartMemoryCollector ¶
func StartMemoryCollector(tb testing.TB) (*MemoryCollector, error)
func (*MemoryCollector) Addr ¶
func (l *MemoryCollector) Addr() string
func (*MemoryCollector) Export ¶
func (l *MemoryCollector) Export( ctx context.Context, request *ctrace.ExportTraceServiceRequest, ) (*ctrace.ExportTraceServiceResponse, error)
func (*MemoryCollector) Spans ¶
func (l *MemoryCollector) Spans() []*trace.ResourceSpans
type MemoryExporter ¶
type MemoryExporter struct {
// contains filtered or unexported fields
}
MemoryExporter is a span exporter that collects spans in memory.
Note that internally it defers to otlptrace.Exporter to handle the actual export, since the code to transform spans to the exportable format is quite complex and not exported directly. By providing a custom "client", we can intercept the exported spans and write them to a file on request.
func NewFileExporter ¶
func NewFileExporter(outDir string) *MemoryExporter
func (*MemoryExporter) ExportSpans ¶
func (e *MemoryExporter) ExportSpans( ctx context.Context, spans []sdktrace.ReadOnlySpan, ) error
Click to show internal directories.
Click to hide internal directories.