exporter

package
v0.0.0-...-465b952 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigPath = "/etc/eventexporter/exporter.yaml"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Route          Route                  `yaml:"route"`
	ReceiverConfig []sinks.ReceiverConfig `yaml:"receiverConfigs"`
}

type Engine

type Engine struct {
	Route Route
}

func NewEngine

func NewEngine() (*Engine, error)

func (*Engine) OnEvent

func (e *Engine) OnEvent(ev *kube.EnhancedEvent)

OnEvent does not care whether event is add or update. Prior filtering should be done int the controller/watcher

func (*Engine) Stop

func (e *Engine) Stop()

type Route

type Route struct {
	Drop   []Rule
	Match  []Rule
	Routes []Route
}

Route allows using rules to drop events or match events to specific receivers. It also allows using routes recursively for complex route building to fit most of the needs

func (*Route) ProcessEvent

func (r *Route) ProcessEvent(ev *kube.EnhancedEvent)

type Rule

type Rule struct {
	Labels      map[string]string
	Annotations map[string]string
	Message     string
	APIVersion  string
	Kind        string
	Namespace   string
	Reason      string
	Type        string
	MinCount    int32
	Component   string
	Host        string
	Receiver    string
}

Rule is for matching an event

func (*Rule) MatchesEvent

func (r *Rule) MatchesEvent(ev *kube.EnhancedEvent) bool

MatchesEvent compares the rule to an event and returns a boolean value to indicate whether the event is compatible with the rule. All fields are compared as regular expressions so the user must keep that in mind while writing rules.

Jump to

Keyboard shortcuts

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