Problem
jailoc has no visibility into CLI crashes or errors in the wild. When users hit failures (Docker errors, config validation, panics), there's no telemetry to understand failure patterns.
Proposal
Integrate sentry-go SDK for crash reporting, enabled by default (opt-out via DO_NOT_TRACK=1).
Integration point
Single capture boundary in cmd/jailoc/main.go around cmd.Execute():
- Error capture: all
RunE errors from every subcommand bubble up through Execute() — capture there before os.Exit(1)
- Panic recovery: no
recover() exists today — add sentry.Recover() as deferred call
- Flush:
HTTPSyncTransport (blocking) since CLI is short-lived; double flush (defer + before os.Exit) because defers don't run on os.Exit
Key decisions
- Opt-out via
DO_NOT_TRACK=1 — follows Console Do Not Track convention
- DSN hardcoded in source — works with all install methods (
go install, GoReleaser, manual build); DSN is a public ingest key, not a secret
HTTPSyncTransport — async transport risks losing events before CLI exits
Release from existing -ldflags version — reuse version already embedded at build time
AttachStacktrace: true — useful for CLI error context
New dependency
github.com/getsentry/sentry-go
Scope
cmd/jailoc/main.go — init, capture, flush, hardcoded DSN
- Docs — mention telemetry and
DO_NOT_TRACK=1 opt-out
Problem
jailoc has no visibility into CLI crashes or errors in the wild. When users hit failures (Docker errors, config validation, panics), there's no telemetry to understand failure patterns.
Proposal
Integrate
sentry-goSDK for crash reporting, enabled by default (opt-out viaDO_NOT_TRACK=1).Integration point
Single capture boundary in
cmd/jailoc/main.goaroundcmd.Execute():RunEerrors from every subcommand bubble up throughExecute()— capture there beforeos.Exit(1)recover()exists today — addsentry.Recover()as deferred callHTTPSyncTransport(blocking) since CLI is short-lived; double flush (defer + beforeos.Exit) because defers don't run onos.ExitKey decisions
DO_NOT_TRACK=1— follows Console Do Not Track conventiongo install, GoReleaser, manual build); DSN is a public ingest key, not a secretHTTPSyncTransport— async transport risks losing events before CLI exitsReleasefrom existing-ldflagsversion — reuseversionalready embedded at build timeAttachStacktrace: true— useful for CLI error contextNew dependency
github.com/getsentry/sentry-goScope
cmd/jailoc/main.go— init, capture, flush, hardcoded DSNDO_NOT_TRACK=1opt-out