dependencyhealth

package
v2.56.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostMetricsRegistry

type HostMetricsRegistry interface {
	HostMetrics(serviceName string, hostname string, port string) HostStatus
	AllServices() map[ServiceName]map[HostPort]HostStatus
}

func NewHostRegistry

func NewHostRegistry(windowSize time.Duration) HostMetricsRegistry

NewHostRegistry returns a new HostMetricsRegistry that is safe for concurrent use and should generally be used as a singleton per application. Metrics are used for internal tracking and not registered on the default registry emitted by witchcraft.

type HostPort

type HostPort string

HostPort is a 'host:port' string.

type HostStatus

type HostStatus interface {
	IsActive() bool
	IsHealthy() bool

	Mark2xx()
	Mark3xx()
	Mark4xx()
	Mark5xx()
	MarkError()
	MarkOther()
}

type ServiceDependencyHealthCheck

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

func NewServiceDependencyHealthCheck

func NewServiceDependencyHealthCheck() *ServiceDependencyHealthCheck

NewServiceDependencyHealthCheck returns the SERVICE_DEPENDENCY health check. For each service, it measures the ratio of submitted results representing errors from each host. When a host returns fewer 2xx responses than 5xx and network errors, it is unhealthy.

This should be a singleton within an application. No (known) support exists for merging multiple service dependency checks.

func (*ServiceDependencyHealthCheck) HealthStatus

HealthStatus iterates through all tracked hosts for each service. If there are both healthy and unhealthy hosts, the check is HEALTHY but details are included in the message and params. If there are only unhealthy hosts for at least one service, the check is WARNING.

func (*ServiceDependencyHealthCheck) Middleware

func (h *ServiceDependencyHealthCheck) Middleware(serviceName string) httpclient.Middleware

type ServiceDependencyMiddleware

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

func (ServiceDependencyMiddleware) RoundTrip

type ServiceName

type ServiceName string

Jump to

Keyboard shortcuts

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