Documentation
¶
Overview ¶
Package tracingtest captures the spans Genkit reports, in memory and with no OpenTelemetry SDK, for tests across the module. core/tracing's own tests cannot import it (import cycle) and keep local helpers.
The instrumentation registry is process-wide, so a test that calls Capture must not run in parallel with other tests that read spans.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Recorder ¶
type Recorder struct {
*tracing.TestOnlyTelemetryClient
}
Recorder is an in-memory capture of the spans Genkit reports.
func Capture ¶
Capture routes spans to a fresh recorder for the rest of the test, then restores the InstallDefault provider (or the implicit default) on cleanup.
func InstallDefault ¶
func InstallDefault() *Recorder
InstallDefault routes every span in the test binary to an in-memory recorder, so runs carry real trace ids without an OpenTelemetry SDK. Call it from TestMain; Capture restores it after each capturing test.