Documentation
¶
Overview ¶
Package observability wires optional Sentry-wire error reporting (e.g. the self-hosted GlitchTip at errors.example.com) into filex. Everything here is a no-op unless a DSN is configured, so a default build reports nothing.
The primary integration is a slog.Handler that forwards WARN+ERROR log records to Sentry, so operational failures already surfaced via slog — the worker's "ops: step failed", storage errors, recovered panics — show up in GlitchTip without sprinkling capture calls through the codebase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flush ¶
func Flush()
Flush drains buffered events — call on shutdown. No-op when uninitialized.
Types ¶
type SlogHandler ¶
type SlogHandler struct {
// contains filtered or unexported fields
}
SlogHandler wraps a base slog.Handler and forwards WARN+ERROR records to Sentry (grouped by log message), so operational failures land in GlitchTip. WARN is only forwarded when it carries an `err` attribute — that filters out benign warnings while keeping real failures like "ops: step failed".
Every attribute on the record travels with the event, because an event without them is not actionable: "thumb generate failed" is a question ("which file? which error?") until `path` and `err` are next to it. Short values become tags — searchable, shown in the issue list — and the full set (long values included) goes into the `log` context. Values whose key looks like a credential are replaced with a marker before either.