Documentation
¶
Overview ¶
Package telemetrytest holds runner-independent conformance cases for telemetry.TelemetryContext adapters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoreFixture ¶
type StoreFixture struct {
Context telemetry.TelemetryContext
Store telemetry.TelemetryStore
Flush func(context.Context) error
Dispose func(context.Context) error
}
StoreFixture is a fresh store, the context that records into it, and the flush that makes recorded telemetry readable. Context supplies the Metrics and Propagation capabilities. A nil Flush readies nothing; a nil Dispose releases nothing.
type StoreFixtureFactory ¶
type StoreFixtureFactory func(context.Context) (StoreFixture, error)
StoreFixtureFactory creates an isolated store fixture for one conformance case.
type TelemetryAdapterConformanceCase ¶
type TelemetryAdapterConformanceCase struct {
Group string
Name string
Run func(context.Context) error
}
TelemetryAdapterConformanceCase is a runner-independent conformance case that can be registered with any test framework. Run returns the first failed check.
func CreateTelemetryAdapterConformance ¶
func CreateTelemetryAdapterConformance(factory TelemetryAdapterFixtureFactory) []TelemetryAdapterConformanceCase
CreateTelemetryAdapterConformance creates runner-independent cases for the callback telemetry adapter contract.
func CreateTelemetryStoreConformance ¶
func CreateTelemetryStoreConformance(name string, factory StoreFixtureFactory) []TelemetryAdapterConformanceCase
CreateTelemetryStoreConformance creates runner-independent cases for the shared read-store checks, with no raw-measurement or backend-specific persistence assumptions. Every case carries name as its Group.
type TelemetryAdapterFixture ¶
type TelemetryAdapterFixture struct {
Context telemetry.TelemetryContext
Propagation telemetry.TelemetryPropagation
Metrics telemetry.TelemetryMetrics
GetMetrics func(context.Context) ([]telemetry.RecordedTelemetryMeasurement, error)
GetSpans func(context.Context) ([]telemetry.RecordedTelemetrySpan, error)
Dispose func(context.Context) error
}
TelemetryAdapterFixture is a fresh adapter instance and normalized snapshot reader owned by one conformance case. Propagation and Metrics are the adapter's optional capabilities: a nil one skips its cases. A fixture with Metrics supplies GetMetrics, its normalized measurement reader. Dispose ports Symbol.asyncDispose; a nil Dispose releases nothing.
type TelemetryAdapterFixtureFactory ¶
type TelemetryAdapterFixtureFactory func(context.Context) (TelemetryAdapterFixture, error)
TelemetryAdapterFixtureFactory creates an isolated adapter fixture for one conformance case.