monitor

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNegativeInterval = errors.New("negative interval")

Functions

func GetLastSeen

func GetLastSeen(service string) time.Time

func NewMonitor added in v0.11.0

func NewMonitor(r routes.Route) health.HealthMonCheck

func SetLastSeen

func SetLastSeen(service string, lastSeen time.Time)

func UpdateLastSeen

func UpdateLastSeen(service string)

Types

type AgentCheckHealthTarget added in v0.10.0

type AgentCheckHealthTarget struct {
	Scheme string
	Host   string
	Path   string
}

func AgentTargetFromURL added in v0.10.0

func AgentTargetFromURL(url *url.URL) *AgentCheckHealthTarget

type AgentProxiedMonitor added in v0.10.0

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

func NewAgentProxiedMonitor added in v0.10.0

func NewAgentProxiedMonitor(agent *agentPkg.AgentConfig, config *health.HealthCheckConfig, target *AgentCheckHealthTarget) *AgentProxiedMonitor

func (*AgentProxiedMonitor) CheckHealth added in v0.10.0

func (mon *AgentProxiedMonitor) CheckHealth() (result *health.HealthCheckResult, err error)

func (AgentProxiedMonitor) Config added in v0.10.0

func (mon AgentProxiedMonitor) Config() *health.HealthCheckConfig

Config implements HealthChecker.

func (AgentProxiedMonitor) ContextWithTimeout added in v0.10.0

func (mon AgentProxiedMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)

func (AgentProxiedMonitor) Finish added in v0.10.0

func (mon AgentProxiedMonitor) Finish(reason any)

Finish implements task.TaskFinisher.

func (AgentProxiedMonitor) Latency added in v0.10.0

func (mon AgentProxiedMonitor) Latency() time.Duration

Latency implements HealthMonitor.

func (AgentProxiedMonitor) MarshalJSON added in v0.10.0

func (mon AgentProxiedMonitor) MarshalJSON() ([]byte, error)

MarshalJSON implements health.HealthMonitor.

func (AgentProxiedMonitor) Name added in v0.10.0

func (mon AgentProxiedMonitor) Name() string

Name implements HealthMonitor.

func (AgentProxiedMonitor) Start added in v0.10.0

func (mon AgentProxiedMonitor) Start(parent task.Parent) gperr.Error

Start implements task.TaskStarter.

func (AgentProxiedMonitor) Status added in v0.10.0

func (mon AgentProxiedMonitor) Status() health.Status

Status implements HealthMonitor.

func (AgentProxiedMonitor) String added in v0.10.0

func (mon AgentProxiedMonitor) String() string

String implements fmt.Stringer of HealthMonitor.

func (AgentProxiedMonitor) Task added in v0.10.0

func (mon AgentProxiedMonitor) Task() *task.Task

Task implements task.TaskStarter.

func (AgentProxiedMonitor) URL added in v0.10.0

func (mon AgentProxiedMonitor) URL() *url.URL

URL implements HealthChecker.

func (AgentProxiedMonitor) UpdateURL added in v0.10.0

func (mon AgentProxiedMonitor) UpdateURL(url *url.URL)

UpdateURL implements HealthChecker.

func (AgentProxiedMonitor) Uptime added in v0.10.0

func (mon AgentProxiedMonitor) Uptime() time.Duration

Uptime implements HealthMonitor.

type DockerHealthMonitor

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

func NewDockerHealthMonitor

func NewDockerHealthMonitor(client *docker.SharedClient, containerID, alias string, config *health.HealthCheckConfig, fallback health.HealthChecker) *DockerHealthMonitor

func (*DockerHealthMonitor) CheckHealth

func (mon *DockerHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)

func (DockerHealthMonitor) Config

func (mon DockerHealthMonitor) Config() *health.HealthCheckConfig

Config implements HealthChecker.

func (DockerHealthMonitor) ContextWithTimeout

func (mon DockerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)

func (DockerHealthMonitor) Finish

func (mon DockerHealthMonitor) Finish(reason any)

Finish implements task.TaskFinisher.

func (DockerHealthMonitor) Latency

func (mon DockerHealthMonitor) Latency() time.Duration

Latency implements HealthMonitor.

func (DockerHealthMonitor) MarshalJSON

func (mon DockerHealthMonitor) MarshalJSON() ([]byte, error)

MarshalJSON implements health.HealthMonitor.

func (DockerHealthMonitor) Name

func (mon DockerHealthMonitor) Name() string

Name implements HealthMonitor.

func (DockerHealthMonitor) Start

func (mon DockerHealthMonitor) Start(parent task.Parent) gperr.Error

Start implements task.TaskStarter.

func (DockerHealthMonitor) Status

func (mon DockerHealthMonitor) Status() health.Status

Status implements HealthMonitor.

func (DockerHealthMonitor) String

func (mon DockerHealthMonitor) String() string

String implements fmt.Stringer of HealthMonitor.

func (DockerHealthMonitor) Task

func (mon DockerHealthMonitor) Task() *task.Task

Task implements task.TaskStarter.

func (DockerHealthMonitor) URL

func (mon DockerHealthMonitor) URL() *url.URL

URL implements HealthChecker.

func (DockerHealthMonitor) UpdateURL

func (mon DockerHealthMonitor) UpdateURL(url *url.URL)

UpdateURL implements HealthChecker.

func (DockerHealthMonitor) Uptime

func (mon DockerHealthMonitor) Uptime() time.Duration

Uptime implements HealthMonitor.

type FileServerHealthMonitor

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

func NewFileServerHealthMonitor

func NewFileServerHealthMonitor(config *health.HealthCheckConfig, path string) *FileServerHealthMonitor

func (*FileServerHealthMonitor) CheckHealth

func (FileServerHealthMonitor) Config

func (mon FileServerHealthMonitor) Config() *health.HealthCheckConfig

Config implements HealthChecker.

func (FileServerHealthMonitor) ContextWithTimeout

func (mon FileServerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)

func (FileServerHealthMonitor) Finish

func (mon FileServerHealthMonitor) Finish(reason any)

Finish implements task.TaskFinisher.

func (FileServerHealthMonitor) Latency

func (mon FileServerHealthMonitor) Latency() time.Duration

Latency implements HealthMonitor.

func (FileServerHealthMonitor) MarshalJSON

func (mon FileServerHealthMonitor) MarshalJSON() ([]byte, error)

MarshalJSON implements health.HealthMonitor.

func (FileServerHealthMonitor) Name

func (mon FileServerHealthMonitor) Name() string

Name implements HealthMonitor.

func (FileServerHealthMonitor) Start

func (mon FileServerHealthMonitor) Start(parent task.Parent) gperr.Error

Start implements task.TaskStarter.

func (FileServerHealthMonitor) Status

func (mon FileServerHealthMonitor) Status() health.Status

Status implements HealthMonitor.

func (FileServerHealthMonitor) String

func (mon FileServerHealthMonitor) String() string

String implements fmt.Stringer of HealthMonitor.

func (FileServerHealthMonitor) Task

func (mon FileServerHealthMonitor) Task() *task.Task

Task implements task.TaskStarter.

func (FileServerHealthMonitor) URL

func (mon FileServerHealthMonitor) URL() *url.URL

URL implements HealthChecker.

func (FileServerHealthMonitor) UpdateURL

func (mon FileServerHealthMonitor) UpdateURL(url *url.URL)

UpdateURL implements HealthChecker.

func (FileServerHealthMonitor) Uptime

func (mon FileServerHealthMonitor) Uptime() time.Duration

Uptime implements HealthMonitor.

type HTTPHealthMonitor

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

func NewHTTPHealthMonitor

func NewHTTPHealthMonitor(url *url.URL, config *health.HealthCheckConfig) *HTTPHealthMonitor

func (*HTTPHealthMonitor) CheckHealth

func (mon *HTTPHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)

func (HTTPHealthMonitor) Config

func (mon HTTPHealthMonitor) Config() *health.HealthCheckConfig

Config implements HealthChecker.

func (HTTPHealthMonitor) ContextWithTimeout

func (mon HTTPHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)

func (HTTPHealthMonitor) Finish

func (mon HTTPHealthMonitor) Finish(reason any)

Finish implements task.TaskFinisher.

func (HTTPHealthMonitor) Latency

func (mon HTTPHealthMonitor) Latency() time.Duration

Latency implements HealthMonitor.

func (HTTPHealthMonitor) MarshalJSON

func (mon HTTPHealthMonitor) MarshalJSON() ([]byte, error)

MarshalJSON implements health.HealthMonitor.

func (HTTPHealthMonitor) Name

func (mon HTTPHealthMonitor) Name() string

Name implements HealthMonitor.

func (HTTPHealthMonitor) Start

func (mon HTTPHealthMonitor) Start(parent task.Parent) gperr.Error

Start implements task.TaskStarter.

func (HTTPHealthMonitor) Status

func (mon HTTPHealthMonitor) Status() health.Status

Status implements HealthMonitor.

func (HTTPHealthMonitor) String

func (mon HTTPHealthMonitor) String() string

String implements fmt.Stringer of HealthMonitor.

func (HTTPHealthMonitor) Task

func (mon HTTPHealthMonitor) Task() *task.Task

Task implements task.TaskStarter.

func (HTTPHealthMonitor) URL

func (mon HTTPHealthMonitor) URL() *url.URL

URL implements HealthChecker.

func (HTTPHealthMonitor) UpdateURL

func (mon HTTPHealthMonitor) UpdateURL(url *url.URL)

UpdateURL implements HealthChecker.

func (HTTPHealthMonitor) Uptime

func (mon HTTPHealthMonitor) Uptime() time.Duration

Uptime implements HealthMonitor.

type HealthCheckFunc

type HealthCheckFunc func() (result *health.HealthCheckResult, err error)

type RawHealthMonitor

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

func NewRawHealthMonitor

func NewRawHealthMonitor(url *url.URL, config *health.HealthCheckConfig) *RawHealthMonitor

func (*RawHealthMonitor) CheckHealth

func (mon *RawHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)

func (RawHealthMonitor) Config

func (mon RawHealthMonitor) Config() *health.HealthCheckConfig

Config implements HealthChecker.

func (RawHealthMonitor) ContextWithTimeout

func (mon RawHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)

func (RawHealthMonitor) Finish

func (mon RawHealthMonitor) Finish(reason any)

Finish implements task.TaskFinisher.

func (RawHealthMonitor) Latency

func (mon RawHealthMonitor) Latency() time.Duration

Latency implements HealthMonitor.

func (RawHealthMonitor) MarshalJSON

func (mon RawHealthMonitor) MarshalJSON() ([]byte, error)

MarshalJSON implements health.HealthMonitor.

func (RawHealthMonitor) Name

func (mon RawHealthMonitor) Name() string

Name implements HealthMonitor.

func (RawHealthMonitor) Start

func (mon RawHealthMonitor) Start(parent task.Parent) gperr.Error

Start implements task.TaskStarter.

func (RawHealthMonitor) Status

func (mon RawHealthMonitor) Status() health.Status

Status implements HealthMonitor.

func (RawHealthMonitor) String

func (mon RawHealthMonitor) String() string

String implements fmt.Stringer of HealthMonitor.

func (RawHealthMonitor) Task

func (mon RawHealthMonitor) Task() *task.Task

Task implements task.TaskStarter.

func (RawHealthMonitor) URL

func (mon RawHealthMonitor) URL() *url.URL

URL implements HealthChecker.

func (RawHealthMonitor) UpdateURL

func (mon RawHealthMonitor) UpdateURL(url *url.URL)

UpdateURL implements HealthChecker.

func (RawHealthMonitor) Uptime

func (mon RawHealthMonitor) Uptime() time.Duration

Uptime implements HealthMonitor.

Jump to

Keyboard shortcuts

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