Documentation
¶
Index ¶
- func RegisterRuleEngineFactory(factory RuleEngineFactory)
- type IncidentEngine
- type Option
- func WithConsumerOption(opt correlator.Option) Option
- func WithContext(ctx context.Context) Option
- func WithCorrelationWindow(window time.Duration) Option
- func WithEventRecorder(recorder events.EventRecorder) Option
- func WithRuleEngine(ruleEngine RuleEngine) Option
- func WithRuleEngineName(name string) Option
- type RuleEngine
- type RuleEngineConfig
- type RuleEngineDiscovery
- type RuleEngineFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRuleEngineFactory ¶
func RegisterRuleEngineFactory(factory RuleEngineFactory)
RegisterRuleEngineFactory makes a rule engine available for automatic discovery by the incident engine.
Types ¶
type IncidentEngine ¶
type IncidentEngine struct {
// contains filtered or unexported fields
}
IncidentEngine is the runtime bridge from collected signals to durable incident state.
func NewIncidentEngine ¶
func NewIncidentEngine( c client.Client, signals <-chan collectors.Signal, logger logr.Logger, opts ...Option, ) (*IncidentEngine, error)
NewIncidentEngine resolves a rule engine automatically and wires it into the incident processing runtime.
func (*IncidentEngine) NeedLeaderElection ¶ added in v0.0.12
func (e *IncidentEngine) NeedLeaderElection() bool
NeedLeaderElection ensures only the active leader runs the incident engine.
func (*IncidentEngine) RuleEngineName ¶
func (e *IncidentEngine) RuleEngineName() string
func (*IncidentEngine) Run ¶
func (e *IncidentEngine) Run(ctx context.Context)
type Option ¶
type Option func(*incidentEngineOptions)
func WithConsumerOption ¶
func WithConsumerOption(opt correlator.Option) Option
WithConsumerOption appends a low-level consumer option for compatibility while the incident engine surface is being normalized.
func WithContext ¶ added in v0.0.6
WithContext sets the context used for rule engine initialization (e.g. loading CRD rules at startup).
func WithCorrelationWindow ¶
WithCorrelationWindow overrides the temporary correlation window used by the currently resolved rule engine.
func WithEventRecorder ¶
func WithEventRecorder(recorder events.EventRecorder) Option
WithEventRecorder forwards lifecycle events through the incident engine's consumer compatibility layer.
func WithRuleEngine ¶
func WithRuleEngine(ruleEngine RuleEngine) Option
WithRuleEngine allows explicit injection of a rule engine implementation.
func WithRuleEngineName ¶
WithRuleEngineName asks the incident engine to resolve a specific registered rule engine. When unset, the incident engine auto-selects the highest-priority compatible engine.
type RuleEngine ¶
type RuleEngine interface {
correlator.RuleEngine
Name() string
}
RuleEngine is the engine-owned contract for correlated incident evaluation.
type RuleEngineConfig ¶
RuleEngineConfig carries runtime settings into a resolved rule engine.
type RuleEngineDiscovery ¶
type RuleEngineDiscovery struct {
PreferredName string
}
type RuleEngineFactory ¶
type RuleEngineFactory interface {
Name() string
Priority() int
Supports(RuleEngineDiscovery) bool
Build(RuleEngineConfig) (RuleEngine, error)
}
RuleEngineFactory builds a rule engine implementation that the incident engine can discover at runtime.