
debug
Package debug houses opt-in diagnostic services wired by DI when the matching config block is enabled.
Index
type FlightRecorderService
FlightRecorderService adapts *trace.FlightRecorder to lifecycle.Runner and lifecycle.Stopper so the supervisor owns its start/stop and the admin handler can hold the recorder for snapshot reads.
func NewFlightRecorderService
NewFlightRecorderService constructs a service around a FlightRecorder configured with the given minimum window age. The recorder is not started here; Run starts it so a registration-time failure (another recorder already active) surfaces through the supervisor.
func (*FlightRecorderService) Recorder
Recorder returns the underlying *trace.FlightRecorder for the admin snapshot handler to call WriteTo on. Nil-safe so the admin handler can receive a nil service when the feature is disabled and check before use.
func (*FlightRecorderService) Run
Run starts the recorder and blocks until ctx is cancelled. A Start failure (only happens if another recorder is already active in-process) is returned so the supervisor logs it instead of silently no-op’ing.
func (*FlightRecorderService) Stop
Stop ends recording so the ring buffer can be GC’d. Idempotent: calling Stop on a recorder that never started or already stopped is safe.
Generated by gomarkdoc