Documentation
¶
Overview ¶
Package testotel provides test utilities for OpenTelemetry tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCCollector ¶
type GRPCCollector struct {
// contains filtered or unexported fields
}
GRPCCollector is a test OTLP gRPC collector that captures logs, traces, and metrics. gRPC metadata is injected as attributes on each signal for easy assertion.
func StartGRPCCollector ¶
func StartGRPCCollector() (*GRPCCollector, error)
StartGRPCCollector starts a test OTLP gRPC collector on an available port.
func (*GRPCCollector) Address ¶
func (c *GRPCCollector) Address() string
Address returns the full address (host:port) the collector is listening on.
func (*GRPCCollector) Close ¶
func (c *GRPCCollector) Close()
Close shuts down the collector and cleans up resources.
func (*GRPCCollector) Port ¶
func (c *GRPCCollector) Port() int
Port returns the port the collector is listening on.
func (*GRPCCollector) TakeLog ¶
func (c *GRPCCollector) TakeLog() *logsv1.LogRecord
TakeLog returns a single log record or nil if none were recorded within the timeout.
func (*GRPCCollector) TakeMetric ¶
func (c *GRPCCollector) TakeMetric() *metricsv1.ResourceMetrics
TakeMetric returns resource metrics or nil if none were recorded within the timeout.
func (*GRPCCollector) TakeSpan ¶
func (c *GRPCCollector) TakeSpan() *tracev1.Span
TakeSpan returns a single span or nil if none were recorded within the timeout.