Documentation
¶
Index ¶
- type NoOpProvider
- func (n *NoOpProvider) CaptureError(ctx context.Context, err error, severity Severity, ...)
- func (n *NoOpProvider) CaptureMessage(ctx context.Context, message string, severity Severity, ...)
- func (n *NoOpProvider) CapturePanic(ctx context.Context, recovered interface{}, stackTrace []byte, ...)
- func (n *NoOpProvider) Close() error
- func (n *NoOpProvider) Flush(timeout int) bool
- type Provider
- type SentryConfig
- type SentryProvider
- func (s *SentryProvider) CaptureError(ctx context.Context, err error, severity Severity, ...)
- func (s *SentryProvider) CaptureMessage(ctx context.Context, message string, severity Severity, ...)
- func (s *SentryProvider) CapturePanic(ctx context.Context, recovered interface{}, stackTrace []byte, ...)
- func (s *SentryProvider) Close() error
- func (s *SentryProvider) Flush(timeout int) bool
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoOpProvider ¶
type NoOpProvider struct{}
NoOpProvider is a no-op implementation of the Provider interface Used when error tracking is disabled
func NewNoOpProvider ¶
func NewNoOpProvider() *NoOpProvider
NewNoOpProvider creates a new NoOp provider
func (*NoOpProvider) CaptureError ¶
func (n *NoOpProvider) CaptureError(ctx context.Context, err error, severity Severity, extra map[string]interface{})
CaptureError does nothing
func (*NoOpProvider) CaptureMessage ¶
func (n *NoOpProvider) CaptureMessage(ctx context.Context, message string, severity Severity, extra map[string]interface{})
CaptureMessage does nothing
func (*NoOpProvider) CapturePanic ¶
func (n *NoOpProvider) CapturePanic(ctx context.Context, recovered interface{}, stackTrace []byte, extra map[string]interface{})
CapturePanic does nothing
func (*NoOpProvider) Flush ¶
func (n *NoOpProvider) Flush(timeout int) bool
Flush does nothing and returns true
type Provider ¶
type Provider interface {
// CaptureError captures an error with the given severity and additional context
CaptureError(ctx context.Context, err error, severity Severity, extra map[string]interface{})
// CaptureMessage captures a message with the given severity and additional context
CaptureMessage(ctx context.Context, message string, severity Severity, extra map[string]interface{})
// CapturePanic captures a panic with stack trace
CapturePanic(ctx context.Context, recovered interface{}, stackTrace []byte, extra map[string]interface{})
// Flush waits for all events to be sent (useful for graceful shutdown)
Flush(timeout int) bool
// Close closes the provider and releases resources
Close() error
}
Provider defines the interface for error tracking providers
func NewProviderFromConfig ¶
func NewProviderFromConfig(cfg config.ErrorTrackingConfig) (Provider, error)
NewProviderFromConfig creates an error tracking provider based on the configuration
type SentryConfig ¶
type SentryConfig struct {
DSN string
Environment string
Release string
Debug bool
SampleRate float64
TracesSampleRate float64
}
SentryConfig holds the configuration for Sentry
type SentryProvider ¶
type SentryProvider struct {
// contains filtered or unexported fields
}
SentryProvider implements the Provider interface using Sentry
func NewSentryProvider ¶
func NewSentryProvider(config SentryConfig) (*SentryProvider, error)
NewSentryProvider creates a new Sentry provider
func (*SentryProvider) CaptureError ¶
func (s *SentryProvider) CaptureError(ctx context.Context, err error, severity Severity, extra map[string]interface{})
CaptureError captures an error with the given severity and additional context
func (*SentryProvider) CaptureMessage ¶
func (s *SentryProvider) CaptureMessage(ctx context.Context, message string, severity Severity, extra map[string]interface{})
CaptureMessage captures a message with the given severity and additional context
func (*SentryProvider) CapturePanic ¶
func (s *SentryProvider) CapturePanic(ctx context.Context, recovered interface{}, stackTrace []byte, extra map[string]interface{})
CapturePanic captures a panic with stack trace
func (*SentryProvider) Close ¶
func (s *SentryProvider) Close() error
Close closes the provider and releases resources
func (*SentryProvider) Flush ¶
func (s *SentryProvider) Flush(timeout int) bool
Flush waits for all events to be sent (useful for graceful shutdown)