health

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BuildDatabrokerConfig checks whether the Databroker config was applied
	BuildDatabrokerConfig = Check("config.databroker.build")
	// CollectAndSendTelemetry checks whether telemetry was collected and sent
	CollectAndSendTelemetry = Check("zero.telemetry.collect-and-send")
	// StorageBackend checks whether the storage backend is healthy
	StorageBackend = Check("storage.backend")
	// XDSCluster checks whether the XDS Cluster resources were applied
	XDSCluster = Check("xds.cluster")
	// XDSListener checks whether the XDS Listener resources were applied
	XDSListener = Check("xds.listener")
	// XDSRouteConfiguration checks whether the XDS RouteConfiguration resources were applied
	XDSRouteConfiguration = Check("xds.route-configuration")
	// XDSOther is a catch-all for other XDS resources
	XDSOther = Check("xds.other")
	// ZeroBootstrapConfigSave checks whether the Zero bootstrap config was saved
	ZeroBootstrapConfigSave = Check("zero.bootstrap-config.save")
	// ZeroConnect checks whether the Zero Connect service is connected
	ZeroConnect = Check("zero.connect")
	// RoutesReachable checks whether all referenced routes can be resolved to this instance
	RoutesReachable = Check("routes.reachable")
)
View Source
const InternalErrorKey = "internal_error"

InternalErrorKey is the key used to indicate that a check failed due to some non-user facing error

Variables

View Source
var ErrInternalError = errors.New("internal error")

Functions

func ReportError

func ReportError(check Check, err error, attributes ...Attr)

ReportError reports that a check failed

func ReportInternalError added in v0.27.0

func ReportInternalError(check Check, err error, attributes ...Attr)

ReportInternalError reports that a check failed due to an internal error

func ReportOK

func ReportOK(check Check, attributes ...Attr)

ReportOK reports that a check was successful

func SetProvider

func SetProvider(p Provider)

SetProvider sets the health check provider

Types

type Attr

type Attr struct {
	Key   string
	Value string
}

Attr is a key-value pair that can be attached to a health check

func ErrorAttr added in v0.27.0

func ErrorAttr(err error) Attr

ErrorAttr creates a new error attribute, that is used to indicate that a check failed due to some non-user facing error

func StrAttr

func StrAttr(key, value string) Attr

StrAttr creates a new string attribute

type Check

type Check string

func ZeroResourceBundle

func ZeroResourceBundle(bundleID string) Check

ZeroResourceBundle checks whether the Zero resource bundle was applied

type Deduplicator added in v0.27.0

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

Deduplicator is a health check provider that deduplicates health check reports i.e. it only reports a health check if the status or attributes have changed

func NewDeduplicator

func NewDeduplicator() *Deduplicator

func (*Deduplicator) ReportError added in v0.27.0

func (d *Deduplicator) ReportError(check Check, err error, attrs ...Attr)

ReportError implements the Provider interface

func (*Deduplicator) ReportOK added in v0.27.0

func (d *Deduplicator) ReportOK(check Check, attrs ...Attr)

ReportOK implements the Provider interface

func (*Deduplicator) SetProvider added in v0.27.0

func (d *Deduplicator) SetProvider(p Provider)

type Provider

type Provider interface {
	ReportOK(check Check, attributes ...Attr)
	ReportError(check Check, err error, attributes ...Attr)
}

Provider is the interface that must be implemented by a health check reporter

Jump to

Keyboard shortcuts

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