Documentation ¶
Index ¶
- Variables
- func Init(channel chan *ossec.QueuePosting, options sentry.ClientOptions) error
- func NewWrappedCore(innerCore zapcore.Core) zapcore.Core
- type AgentTransport
- type SentryCore
- func (c SentryCore) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
- func (c SentryCore) Enabled(level zapcore.Level) bool
- func (c SentryCore) Sync() error
- func (c SentryCore) With(fld []zapcore.Field) zapcore.Core
- func (c SentryCore) Write(entry zapcore.Entry, fields []zapcore.Field) error
- type SentryEvent
- type SentryIntegrationEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var BeforeSend = func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { if hint != nil { if data, ok := hint.Data.(map[string]interface{}); ok { event.Extra, ok = data["fields"].(map[string]interface{}) } if hint.OriginalException != nil { err := hint.OriginalException for i := 0; i < maxErrorDepth && err != nil; i++ { stackErr := errors.WithStack(err) trace := sentry.ExtractStacktrace(stackErr) if len(trace.Frames) > 3 { trace.Frames = trace.Frames[0 : len(trace.Frames)-3] } event.Exception = append(event.Exception, sentry.Exception{ Value: err.Error(), Type: reflect.TypeOf(err).String(), Stacktrace: trace, }) switch previous := err.(type) { case interface{ Unwrap() error }: err = previous.Unwrap() case interface{ Cause() error }: err = previous.Cause() default: err = nil } } } } if event.Transaction == "" { event.Transaction = "Zap.Logger" } return event }
Functions ¶
func Init ¶
func Init(channel chan *ossec.QueuePosting, options sentry.ClientOptions) error
Types ¶
type AgentTransport ¶
type AgentTransport struct { Project string Version string // contains filtered or unexported fields }
func NewAgentTransport ¶
func NewAgentTransport(channel chan *ossec.QueuePosting) (*AgentTransport, error)
func (*AgentTransport) Configure ¶
func (t *AgentTransport) Configure(options sentry.ClientOptions)
func (*AgentTransport) SendEvent ¶
func (t *AgentTransport) SendEvent(event *sentry.Event)
type SentryCore ¶
type SentryCore struct {
// contains filtered or unexported fields
}
func (SentryCore) Check ¶
func (c SentryCore) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
func (SentryCore) Sync ¶
func (c SentryCore) Sync() error
type SentryEvent ¶
type SentryIntegrationEvent ¶
type SentryIntegrationEvent struct { ossec.IntegrationEvent Sentry interface{} `json:"sentry"` }
Click to show internal directories.
Click to hide internal directories.