sentry

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sentry initializes the Sentry SDK with a shutdown flush hook.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(err error, tags map[string]string)

Capture reports err to Sentry on a cloned hub with the given tags. It is a no-op when err is nil or Sentry was not initialized (no DSN). Use at transport boundaries to report errors no handler dealt with, mirroring the HTTP edge.

func Close

func Close()

Close flushes buffered events; the service registers it as a shutdown hook. It is a no-op when Sentry was never initialized (empty DSN), so it is always safe to register.

func Init

func Init(cfg Config) error

Init initializes the Sentry error tracking SDK. Returns nil if DSN is empty, skipping initialization. The service owns the shutdown flush by registering Close on its app lifecycle.

Types

type Config

type Config struct {
	DSN         string
	Environment string
	Release     string
	Debug       bool
}

Config carries the Sentry client settings supplied by the service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL