Documentation
¶
Overview ¶
Package obs centralises crash reporting and selective error capture via Sentry. Init is a one-shot called from the daemon entry point; after that, callers use Go/SafeGo to launch goroutines with panic recovery and Capture/CaptureMsg to forward selected errors.
When Sentry is disabled or the DSN is empty, every function becomes a no-op wrapper with the same semantics as a plain `go func()` call, so guarded call sites work unchanged in tests and in operator builds that opt out of telemetry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture sends an error to Sentry with a component tag. No-op when disabled or err is nil. Reserve for unexpected states and invariant violations; expected-failure errors (permission denied, transient network) should stay out of Sentry to avoid noise.
func CaptureMsg ¶
func CaptureMsg(component, msg string)
CaptureMsg is Capture for string-only events (e.g. invariant violations without a wrapped error).
func Flush ¶
func Flush()
Flush waits for queued events to be sent before returning. Call from shutdown paths before exit. Safe to call when Sentry is disabled.
func Go ¶
func Go(component string, fn func())
Go launches fn in a new goroutine. A panic in fn is captured with the given component tag, the event is flushed, and the panic is re-raised so the existing crash-and-systemd-restart behavior is preserved. Use this for long-lived supervisor goroutines where a silent death would leave the daemon in a degraded state.
Types ¶
This section is empty.