alerts

package
v1.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	SyncInterval:     5 * time.Minute,
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	Address          string                  `alloy:"address,attr"`
	HTTPClientConfig config.HTTPClientConfig `alloy:",squash"`
	SyncInterval     time.Duration           `alloy:"sync_interval,attr,optional"`

	TemplateFiles map[string]string `alloy:"template_files,attr,optional"`
	GlobalConfig  alloytypes.Secret `alloy:"global_config,attr"`

	AlertmanagerConfigSelector          kubernetes.LabelSelector `alloy:"alertmanagerconfig_selector,block,optional"`
	AlertmanagerConfigNamespaceSelector kubernetes.LabelSelector `alloy:"alertmanagerconfig_namespace_selector,block,optional"`
}

func (*Arguments) SetToDefault

func (args *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*Arguments) Validate

func (args *Arguments) Validate() error

Validate implements syntax.Validator.

type Component

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

func New

func New(o component.Options, args Arguments) (*Component, error)

New creates a new Component and initializes required clients based on the provided configuration. TODO: Add clustering support

func (*Component) CurrentHealth

func (c *Component) CurrentHealth() component.Health

func (*Component) LifecycleUpdate

func (c *Component) LifecycleUpdate(args Arguments)

update updates the Arguments used to create new Kubernetes or Mimir clients when restarting the component in response to configuration or cluster updates.

func (*Component) ReportHealthy

func (c *Component) ReportHealthy()

func (*Component) ReportUnhealthy

func (c *Component) ReportUnhealthy(err error)

func (*Component) Restart

func (c *Component) Restart(ctx context.Context) error

restart stops any existing event processor and starts a new one. This method is a shortcut for calling shutdown, init, and startup in sequence.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

func (*Component) Shutdown

func (c *Component) Shutdown()

shutdown stops processing new events and waits for currently queued ones to be processed. After this method is called eventProcessor is unset and must be recreated.

func (*Component) Startup

func (c *Component) Startup(ctx context.Context) error

startup launches the informers and starts the event loop if this instance is the leader. If it is not the leader, startup does nothing.

func (*Component) SyncState

func (c *Component) SyncState()

func (*Component) Update

func (c *Component) Update(newConfig component.Arguments) error

type ConfigUpdate

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

Jump to

Keyboard shortcuts

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