eventmonitor

package
v0.0.0-...-1c2acb4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package eventmonitor holds eventmonitor related files

Package eventmonitor holds eventmonitor related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventConsumer

type EventConsumer interface {
	// IDer implements the ID method to return unique ID of the event consumer
	probe.IDer
	// Start starts the event consumer
	Start() error
	// Stop stops the event consumer
	Stop()
}

EventConsumer provides a state interface for any consumers of the event_monitor module. Each event consumer should also implement the EventConsumerHandler interface to handle the retrieved events

type EventConsumerHandler

type EventConsumerHandler interface {
	probe.EventConsumerHandler
}

EventConsumerHandler provides an interface for event consumer handlers

type EventConsumerPostProbeStartHandler

type EventConsumerPostProbeStartHandler interface {
	// PostProbeStart is called after the event stream (the probe) is started
	PostProbeStart() error
}

EventConsumerPostProbeStartHandler defines an event consumer that can respond to PostProbeStart events

type EventMonitor

type EventMonitor struct {
	sync.RWMutex
	Probe *probe.Probe

	Config       *config.Config
	StatsdClient statsd.ClientInterface
	GRPCServer   *grpc.Server
	// contains filtered or unexported fields
}

EventMonitor represents the system-probe module for kernel event monitoring

func NewEventMonitor

func NewEventMonitor(config *config.Config, secconfig *secconfig.Config, opts Opts) (*EventMonitor, error)

NewEventMonitor instantiates an event monitoring system-probe module

func (*EventMonitor) AddEventConsumerHandler

func (m *EventMonitor) AddEventConsumerHandler(consumer EventConsumerHandler) error

AddEventConsumerHandler registers an event handler

func (*EventMonitor) Close

func (m *EventMonitor) Close()

Close the module

func (*EventMonitor) GetStats

func (m *EventMonitor) GetStats() map[string]interface{}

GetStats returns statistics about the module

func (*EventMonitor) Init

func (m *EventMonitor) Init() error

Init initializes the module

func (*EventMonitor) Register

func (m *EventMonitor) Register(_ *module.Router) error

Register the event monitoring module

func (*EventMonitor) RegisterEventConsumer

func (m *EventMonitor) RegisterEventConsumer(consumer EventConsumer)

RegisterEventConsumer registers an event consumer

func (*EventMonitor) SendStats

func (m *EventMonitor) SendStats()

SendStats send stats

func (*EventMonitor) Start

func (m *EventMonitor) Start() error

Start the module

type Opts

type Opts struct {
	ProbeOpts    probe.Opts
	StatsdClient statsd.ClientInterface
}

Opts defines options that can be used for the eventmonitor

Directories

Path Synopsis
Package config holds config related files
Package config holds config related files
Package consumers contains consumers that can be readily used by other packages without having to implement the EventConsumerHandler interface manually: - ProcessConsumer (process.go): a consumer of process exec/exit events that can be subscribed to via callbacks
Package consumers contains consumers that can be readily used by other packages without having to implement the EventConsumerHandler interface manually: - ProcessConsumer (process.go): a consumer of process exec/exit events that can be subscribed to via callbacks
Package examples provides an example of how to use the event monitor module using a basic consumer
Package examples provides an example of how to use the event monitor module using a basic consumer
proto
api
Package testutil provides utilities for using the event monitor in tests
Package testutil provides utilities for using the event monitor in tests

Jump to

Keyboard shortcuts

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