probes

package
v4.66.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("probe timed out")

ErrTimeout is the error thrown when the probe can't reach the endpoint for a longer period of time.

Functions

func PGWithCA

func PGWithCA(ca []byte) func(*pgxpool.Config) error

PGWithCA adds the provided CA to the rootCAs of the pgxpool.

Types

type FailingProbe added in v4.49.1

type FailingProbe struct {
	Service   string
	Name      string
	Namespace string
	Error     error
}

FailingProbe is a prober that will always fail.

func NewFailingProbe added in v4.49.1

func NewFailingProbe(service, name, namespace string, err error) (*FailingProbe, error)

NewFailing creates a prober that will fail. Can be used if the controller can't access valid credentials.

func (FailingProbe) Close added in v4.49.1

func (p FailingProbe) Close() error

Close closes open connections.

func (FailingProbe) GetInfo added in v4.49.1

func (p FailingProbe) GetInfo() ProbeInfo

GetInfo returns the prober infos

func (FailingProbe) Probe added in v4.49.1

func (p FailingProbe) Probe(ctx context.Context) error

Will always return error, as this is a failing probe.

type HTTP added in v4.62.2

type HTTP struct {
	ProbeInfo
	// contains filtered or unexported fields
}

func NewHTTP added in v4.62.2

func NewHTTP(url string, tlsEnabled bool, cacert *x509.Certificate, service, name, namespace, organization, servicelevel string, ha bool) *HTTP

func (*HTTP) Close added in v4.62.2

func (h *HTTP) Close() error

func (*HTTP) GetInfo added in v4.62.2

func (h *HTTP) GetInfo() ProbeInfo

func (*HTTP) Probe added in v4.62.2

func (h *HTTP) Probe(ctx context.Context) error

type Manager

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

Manager manages a collection of Probers the check connectivity to AppCat services.

func NewManager

func NewManager(l logr.Logger, maintenanceStatus maintenancecontroller.MaintenanceStatus) Manager

NewManager returns a new manager.

func (Manager) Collector

func (m Manager) Collector() prometheus.Collector

Collector returns the histogram to store the probe results

func (Manager) StartProbe

func (m Manager) StartProbe(p Prober)

StartProbe will send a probe once every second using the provided prober. If a prober with the same ProbeInfo already runs, it will stop the running prober.

func (Manager) StopProbe

func (m Manager) StopProbe(pi ProbeInfo)

StopProbe will stop the prober with the provided ProbeInfo. Is a Noop if none is running.

type MariaDB added in v4.66.0

type MariaDB struct {
	Service       string
	Name          string
	Namespace     string
	Organization  string
	HighAvailable bool
	ServiceLevel  string
	// contains filtered or unexported fields
}

MariaDB is a prober to test the uptime of a MariaDB instance.

func NewFailingMariaDB added in v4.66.0

func NewFailingMariaDB(service, name, namespace string) (*MariaDB, error)

NewFailingMariaDB creates a prober that will fail. Can be used if the controller can't access valid credentials.

func NewMariaDB added in v4.66.0

func NewMariaDB(service, name, namespace, dsn, organization, caCRT, serviceLevel string, ha, TLSEnabled bool) (*MariaDB, error)

NewMariaDB connects to the provided dsn and returns a prober

func (MariaDB) Close added in v4.66.0

func (p MariaDB) Close() error

Close closes open connections to the MariaDB server.

func (MariaDB) GetInfo added in v4.66.0

func (p MariaDB) GetInfo() ProbeInfo

GetInfo returns the prober infos

func (MariaDB) Probe added in v4.66.0

func (p MariaDB) Probe(ctx context.Context) error

Probe sends a test query to the configured MariaDB server. Will return an error if the prober does not have a valid db connection.

type PostgreSQL

type PostgreSQL struct {
	Service       string
	Name          string
	Namespace     string
	Organization  string
	HighAvailable bool
	ServiceLevel  string
	// contains filtered or unexported fields
}

PostgreSQL is a prober to test the uptime of a PostgreSQL instance.

func NewFailingPostgreSQL

func NewFailingPostgreSQL(service, name, namespace string) (*PostgreSQL, error)

NewFailingPostgreSQL creates a prober that will fail. Can be used if the controller can't access valid credentials.

func NewPostgreSQL

func NewPostgreSQL(service, name, namespace, dsn, organization, sla string, ha bool, ops ...func(*pgxpool.Config) error) (*PostgreSQL, error)

NewPostgreSQL connects to the provided dsn and returns a prober

func (PostgreSQL) Close

func (p PostgreSQL) Close() error

Close closes open connections to the PostgreSQL server.

func (PostgreSQL) GetInfo

func (p PostgreSQL) GetInfo() ProbeInfo

GetInfo returns the prober infos

func (PostgreSQL) Probe

func (p PostgreSQL) Probe(ctx context.Context) error

Probe sends a test query to the configured PostgreSQL server. Will return an error if the prober does not have a valid db connection.

type ProbeInfo

type ProbeInfo struct {
	Service       string
	Name          string
	Namespace     string
	Organization  string
	HighAvailable bool
	ServiceLevel  string
}

ProbeInfo contains meta information on a prober and in turn an AppCat service

func NewProbeInfo added in v4.39.0

func NewProbeInfo(serviceKey string, nn types.NamespacedName, o client.Object) ProbeInfo

type Prober

type Prober interface {
	GetInfo() ProbeInfo
	Probe(ctx context.Context) error
	Close() error
}

Prober checks the connectivity to an AppCat service

type VSHNMinio added in v4.39.0

type VSHNMinio struct {
	Service       string
	Name          string
	Namespace     string
	HighAvailable bool
	Organization  string
	ServiceLevel  string
	// contains filtered or unexported fields
}

func NewMinio added in v4.39.0

func NewMinio(service, name, namespace, organization, sla, endpointURL string, ha bool, opts miniolib.Options) (*VSHNMinio, error)

func (VSHNMinio) Close added in v4.39.0

func (minio VSHNMinio) Close() error

func (VSHNMinio) GetInfo added in v4.39.0

func (minio VSHNMinio) GetInfo() ProbeInfo

func (VSHNMinio) Probe added in v4.39.0

func (minio VSHNMinio) Probe(ctx context.Context) error

type VSHNRedis added in v4.21.0

type VSHNRedis struct {
	Service       string
	Name          string
	Namespace     string
	HighAvailable bool
	Organization  string
	ServiceLevel  string
	// contains filtered or unexported fields
}

func NewRedis added in v4.21.0

func NewRedis(service, name, namespace, organization, sla string, ha bool, opts redis.Options) (*VSHNRedis, error)

func (VSHNRedis) Close added in v4.21.0

func (redis VSHNRedis) Close() error

func (VSHNRedis) GetInfo added in v4.21.0

func (redis VSHNRedis) GetInfo() ProbeInfo

func (VSHNRedis) Probe added in v4.21.0

func (redis VSHNRedis) Probe(ctx context.Context) error

Jump to

Keyboard shortcuts

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