wazuhsentry

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

func NewWrappedCore added in v0.8.3

func NewWrappedCore(innerCore zapcore.Core) zapcore.Core

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) Flush

func (t *AgentTransport) Flush(timeout time.Duration) bool

func (*AgentTransport) SendEvent

func (t *AgentTransport) SendEvent(event *sentry.Event)

type SentryCore

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

func (SentryCore) Check

func (SentryCore) Enabled

func (c SentryCore) Enabled(level zapcore.Level) bool

func (SentryCore) Sync

func (c SentryCore) Sync() error

func (SentryCore) With

func (c SentryCore) With(fld []zapcore.Field) zapcore.Core

func (SentryCore) Write

func (c SentryCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type SentryEvent

type SentryEvent struct {
	*sentry.Event
	Project string `json:"project,omitempty"`
	Version string `json:"version,omitempty"`
}

type SentryIntegrationEvent

type SentryIntegrationEvent struct {
	ossec.IntegrationEvent
	Sentry interface{} `json:"sentry"`
}

Jump to

Keyboard shortcuts

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