Documentation
¶
Index ¶
- Constants
- func EmptyLogger() *log.Helper
- func InitZapLogger(env string) (log.Logger, error)
- func LogAndMaskErr(ctx context.Context, in error, logger *log.Helper) error
- func ScopedHelper(logger log.Logger, scope string) *log.Helper
- func SentryBeforeSend(event *sentry.Event, hint *sentry.EventHint) *sentry.Event
- func SentryHub(ctx context.Context) *sentry.Hub
Constants ¶
const Dev = "dev"
Variables ¶
This section is empty.
Functions ¶
func EmptyLogger ¶
func LogAndMaskErr ¶
LogAndMaskErr records an error but masks it with a generic one to avoid leaking sensitive information. The error is reported on the Sentry hub of ctx when the request has one, so it carries the scope of its own request, and on the global hub otherwise.
func ScopedHelper ¶
ScopedHelper returns a new helper with information about the current component
func SentryBeforeSend ¶ added in v1.104.6
SentryBeforeSend enriches Sentry error events so issues are distinguishable at a glance and group deterministically by failure mode:
- A structured discriminator extends Sentry's default fingerprint
- A generic wrapper type on the primary exception is rewritten to the root-cause type
- Tags expose the root-cause metadata for search
Events without an original error to analyze (messages, transactions) and errors without a structured discriminator are left untouched, preserving Sentry's default grouping. Joined multi-errors (errors.Join) also keep default grouping: bundling independent failures makes any single fingerprint misleading, though their metadata is tagged.
Types ¶
This section is empty.