reporter

package
v0.0.0-...-1694d3b Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(ctx context.Context, err error, meta Metadata)

func CapturePanic

func CapturePanic(ctx context.Context, recovered any, meta Metadata)

func ErrorLocations

func ErrorLocations(err error) string

ErrorLocations returns Juju locations without any messages from the chain.

func ErrorStack

func ErrorStack(err error) string

func IgnoredError

func IgnoredError(err error) bool

func SetDefault

func SetDefault(reporter Reporter)

Types

type Metadata

type Metadata struct {
	Component string
	Operation string
	Stage     string
	Route     string
	Method    string
	Event     string

	Tags   map[string]string
	Extras map[string]any
}

type NoopReporter

type NoopReporter struct{}

func (NoopReporter) Capture

func (NoopReporter) CapturePanic

func (NoopReporter) CapturePanic(context.Context, any, Metadata)

type Reporter

type Reporter interface {
	Capture(ctx context.Context, err error, meta Metadata)
	CapturePanic(ctx context.Context, recovered any, meta Metadata)
}

func Default

func Default() Reporter

type SentryConfig

type SentryConfig struct {
	DSN         string
	Environment string
	Release     string
	ServerName  string
	SampleRate  float64
	Tags        map[string]string
}

type SentryReporter

type SentryReporter struct {
	// contains filtered or unexported fields
}

func NewSentryReporter

func NewSentryReporter(di SentryReporterDI) (*SentryReporter, error)

func (*SentryReporter) Capture

func (r *SentryReporter) Capture(ctx context.Context, err error, meta Metadata)

func (*SentryReporter) CapturePanic

func (r *SentryReporter) CapturePanic(ctx context.Context, recovered any, meta Metadata)

func (*SentryReporter) ServiceName

func (r *SentryReporter) ServiceName() string

func (*SentryReporter) Shutdown

func (r *SentryReporter) Shutdown(ctx context.Context) error

type SentryReporterDI

type SentryReporterDI struct {
	Config SentryConfig
}

Jump to

Keyboard shortcuts

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