sentry

package module
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 11 Imported by: 10

README

sentry

Go Reference

Sentry client with additional functionality and helpers to complement the official one.

Install
go get github.com/altipla-consulting/sentry
Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

License

MIT License

Documentation

Overview

Package sentry has a client with additional functionality and helpers to complement the official one.

Index

Constants

View Source
const (
	LevelFatal   = sentry.LevelFatal
	LevelWarning = sentry.LevelWarning
	LevelError   = sentry.LevelError
	LevelInfo    = sentry.LevelInfo
	LevelDebug   = sentry.LevelDebug
)

Variables

This section is empty.

Functions

func LogBreadcrumb

func LogBreadcrumb(ctx context.Context, level sentry.Level, category, message string)

LogBreadcrumb logs a new breadcrumb in the Sentry instance of the context.

func Tag added in v0.5.0

func Tag(ctx context.Context, key string, value string)

Tag adds a new tag to the Sentry instance of the context.

func WithContext

func WithContext(ctx context.Context) context.Context

WithContext stores a new instance of Sentry in the context and returns the new generated context that you should use everywhere.

func WithRequest added in v0.5.3

func WithRequest(r *http.Request) *http.Request

WithRequest stores a new instance of Sentry in the context and returns the new generated request that you should use everywhere.

Types

type Client

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

Client wraps a Sentry connection.

func NewClient

func NewClient(dsn string) *Client

NewClient opens a new connection to the Sentry report API. If dsn is empty it will return nil. A nil client can be used safely but it won't report anything.

func (*Client) Flush added in v0.6.2

func (client *Client) Flush(timeout time.Duration)

Flush waits until the underlying Transport sends any buffered events.

func (*Client) Report added in v0.4.0

func (client *Client) Report(ctx context.Context, appErr error)

Report reports an error to Sentry.

func (*Client) ReportPanic added in v0.4.0

func (client *Client) ReportPanic(ctx context.Context, panicErr interface{})

ReportPanic sends a panic correctly formated to the server if the argument is not nil.

func (*Client) ReportPanics added in v0.4.0

func (client *Client) ReportPanics(ctx context.Context)

ReportPanics detects panics in the rest of the body of the function and reports it if one occurs.

func (*Client) ReportPanicsRequest deprecated added in v0.4.0

func (client *Client) ReportPanicsRequest(r *http.Request)

Deprecated: Use ReportPanics() after a previous WithRequest() call.

func (*Client) ReportRequest deprecated

func (client *Client) ReportRequest(r *http.Request, appErr error)

Deprecated: Use Report() after a previous WithRequest() call.

Jump to

Keyboard shortcuts

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