Documentation ¶
Index ¶
- Constants
- func LogBreadcrumb(ctx context.Context, level Level, category, message string)
- func WithContext(ctx context.Context) context.Context
- func WithContextRPC(ctx context.Context, rpcService, rpcMethod string) context.Context
- type Client
- func (client *Client) Report(ctx context.Context, appErr error)
- func (client *Client) ReportInternal(ctx context.Context, appErr error)
- func (client *Client) ReportPanics(ctx context.Context)
- func (client *Client) ReportPanicsRequest(r *http.Request)
- func (client *Client) ReportRequest(appErr error, r *http.Request)
- type Level
- type Sentry
Constants ¶
const ( // LevelCritical is a critical breadcrumb. LevelCritical = Level("critical") // LevelWarning is a warning breadcrumb. LevelWarning = Level("warning") // LevelError is an error breadcrumb. LevelError = Level("error") // LevelInfo is an info breadcrumb. LevelInfo = Level("info") // LevelDebug is a debug breadcrumb. LevelDebug = Level("debug") )
Variables ¶
This section is empty.
Functions ¶
func LogBreadcrumb ¶
LogBreadcrumb logs a new breadcrumb in the Sentry instance of the context.
func WithContext ¶
WithContext stores a new instance of Sentry in the context and returns the new generated context that you should use everywhere.
func WithContextRPC ¶
WithContextRPC stores a new instance of Sentry in the context and returns the new generated context that you should use everywhere annotating it with the RPC service name and RPC method name. Used mostly for GRPC calls.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps a Sentry connection.
func (*Client) ReportInternal ¶
ReportInternal reports an error not linked to a HTTP request.
func (*Client) ReportPanics ¶ added in v1.17.0
ReportPanics detects panics in the body of the function and reports them.
func (*Client) ReportPanicsRequest ¶ added in v1.17.0
ReportPanicsRequest detects pancis in the body of the function and reports them linked to a HTTP request.
type Sentry ¶
type Sentry struct {
// contains filtered or unexported fields
}
Sentry accumulates info through out the whole request to send them in case an error is reported.
func FromContext ¶
FromContext returns the Sentry instance stored in the context. If no instance was created it will return nil.