Documentation
¶
Overview ¶
Package sentry provides an enhanced wrapper around the Sentry Go SDK with additional functionality for error exclusion, automatic tag enrichment, and context data extraction.
The main Client interface wraps the official Sentry Go SDK and adds:
- Automatic tag extraction from context and errors
- Configurable error filtering to reduce noise
- Enhanced integration with github.com/bborbe/errors for context data
- Proxy support for HTTP transport
Example usage:
client, err := sentry.NewClient(ctx, sentry.ClientOptions{
Dsn: "your-dsn-here",
Tags: map[string]string{"service": "my-app"},
})
if err != nil {
return err
}
defer client.Close()
// Capture exception with automatic tag enrichment
client.CaptureException(err, &sentry.EventHint{Context: ctx}, nil)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProxyRoundTripper ¶
func NewProxyRoundTripper( roundtripper http.RoundTripper, url string, ) http.RoundTripper
NewProxyRoundTripper allow overwrite sentry host without modifing the alert content.
Types ¶
type Client ¶
type Client interface {
CaptureMessage(
message string,
hint *sentry.EventHint,
scope sentry.EventModifier,
) *sentry.EventID
CaptureException(
exception error,
hint *sentry.EventHint,
scope sentry.EventModifier,
) *sentry.EventID
Flush(timeout stdtime.Duration) bool
io.Closer
}
func NewClient ¶
func NewClient( ctx context.Context, clientOptions sentry.ClientOptions, excludeErrors ...ExcludeError, ) (Client, error)
type ExcludeError ¶
type ExcludeErrors ¶
type ExcludeErrors []ExcludeError
func (ExcludeErrors) IsExcluded ¶
func (e ExcludeErrors) IsExcluded(err error) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.