components

package
v0.1.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package components resolves the upstream executables managed by Arveld.

Index

Constants

View Source
const ManagedAlertmanagerReadinessEndpoint = ManagedAlertmanagerURL + "/-/ready"

ManagedAlertmanagerReadinessEndpoint is the readiness endpoint of managed Alertmanager.

View Source
const ManagedAlertmanagerURL = "http://" + alertmanagerListenAddress

ManagedAlertmanagerURL is the base URL of managed Alertmanager.

View Source
const ManagedPrometheusReadinessEndpoint = ManagedPrometheusURL + "/-/ready"

ManagedPrometheusReadinessEndpoint is the readiness endpoint of managed Prometheus.

View Source
const ManagedPrometheusURL = "http://" + prometheusListenAddress

ManagedPrometheusURL is the base URL of managed Prometheus.

Variables

This section is empty.

Functions

func ValidatePrometheusRetention

func ValidatePrometheusRetention(config PrometheusConfig) error

ValidatePrometheusRetention reports whether Prometheus accepts the retention settings.

func WriteAlertmanagerConfig

func WriteAlertmanagerConfig(dataDirectory string, content []byte) (string, error)

WriteAlertmanagerConfig atomically writes Arveld's generated configuration. Alertmanager validates its schema when starting or reloading the file.

Types

type PrometheusConfig

type PrometheusConfig struct {
	RetentionTime string
	RetentionSize string
}

PrometheusConfig contains the managed Prometheus configuration.

type ReadinessProbe

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

ReadinessProbe checks the current readiness of a component endpoint.

func NewReadinessProbe

func NewReadinessProbe() *ReadinessProbe

NewReadinessProbe creates a readiness probe with a bounded request timeout.

func (*ReadinessProbe) Ready

func (probe *ReadinessProbe) Ready(
	ctx context.Context,
	endpoint string,
) bool

Ready reports whether endpoint currently accepts traffic.

type Supervisor

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

Supervisor installs and runs managed upstream components.

func NewSupervisor

func NewSupervisor(
	config SupervisorConfig,
	logger *slog.Logger,
) *Supervisor

NewSupervisor assembles the installer, readiness probe and process supervision. config.DownloadTimeout must be positive and bounds each archive transfer.

func (*Supervisor) RunManaged

func (supervisor *Supervisor) RunManaged(
	ctx context.Context,
	ready chan<- struct{},
) error

RunManaged supervises Alertmanager and starts Prometheus once Alertmanager is ready. The caller must prepare the Alertmanager configuration before this call. It closes ready once both components are initially ready; ready must be non-nil and owned by this call. The signal does not track later readiness changes. Before returning, RunManaged cancels and waits for all processes and readiness tasks.

type SupervisorConfig

type SupervisorConfig struct {
	DataDirectory   string
	DownloadTimeout time.Duration
	Prometheus      PrometheusConfig
}

SupervisorConfig configures installation and storage of managed components.

Jump to

Keyboard shortcuts

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