checks

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLFinalizedEpochCheck

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

CLFinalizedEpochCheck is a check that verifies if the CL finalized epoch is advancing.

func NewCLFinalizedEpochCheck

func NewCLFinalizedEpochCheck(grafanaClient grafana.Client) *CLFinalizedEpochCheck

NewCLFinalizedEpochCheck creates a new CLFinalizedEpochCheck.

func (*CLFinalizedEpochCheck) Category

func (c *CLFinalizedEpochCheck) Category() Category

Category returns the category of the check.

func (*CLFinalizedEpochCheck) ClientType

func (c *CLFinalizedEpochCheck) ClientType() clients.ClientType

ClientType returns the client type of the check.

func (*CLFinalizedEpochCheck) Name

func (c *CLFinalizedEpochCheck) Name() string

Name returns the name of the check.

func (*CLFinalizedEpochCheck) Run

Run executes the check.

type CLSyncCheck

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

CLSyncCheck is a check that verifies if the CL nodes are syncing.

func NewCLSyncCheck

func NewCLSyncCheck(grafanaClient grafana.Client) *CLSyncCheck

NewCLSyncCheck creates a new CLSyncCheck.

func (*CLSyncCheck) Category

func (c *CLSyncCheck) Category() Category

Category returns the category of the check.

func (*CLSyncCheck) ClientType

func (c *CLSyncCheck) ClientType() clients.ClientType

ClientType returns the client type of the check.

func (*CLSyncCheck) Name

func (c *CLSyncCheck) Name() string

Name returns the name of the check.

func (*CLSyncCheck) Run

func (c *CLSyncCheck) Run(ctx context.Context, log *logger.CheckLogger, cfg Config) (*Result, error)

Run executes the check.

type Category

type Category string

Category represents the type of check.

const (
	CategoryGeneral Category = "general"
	CategorySync    Category = "sync"
)

Define the categories.

func (Category) String

func (c Category) String() string

String returns the string representation of a category.

type Check

type Check interface {
	// Name returns the name of the check.
	Name() string
	// Category returns the category of the check.
	Category() Category
	// ClientType returns the client type of the check.
	ClientType() clients.ClientType
	// Run executes the check and returns the result.
	Run(ctx context.Context, log *logger.CheckLogger, cfg Config) (*Result, error)
}

Check represents a single health check.

type Config

type Config struct {
	Network       string
	ConsensusNode string
	ExecutionNode string
}

Config contains configuration for checks.

type ELBlockHeightCheck

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

ELBlockHeightCheck is a check that verifies if the EL nodes are advancing.

func NewELBlockHeightCheck

func NewELBlockHeightCheck(grafanaClient grafana.Client) *ELBlockHeightCheck

NewELBlockHeightCheck creates a new ELBlockHeightCheck.

func (*ELBlockHeightCheck) Category

func (c *ELBlockHeightCheck) Category() Category

Category returns the category of the check.

func (*ELBlockHeightCheck) ClientType

func (c *ELBlockHeightCheck) ClientType() clients.ClientType

ClientType returns the client type of the check.

func (*ELBlockHeightCheck) Name

func (c *ELBlockHeightCheck) Name() string

Name returns the name of the check.

func (*ELBlockHeightCheck) Run

Run executes the check.

type ELSyncCheck

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

ELSyncCheck is a check that verifies if the EL nodes are syncing.

func NewELSyncCheck

func NewELSyncCheck(grafanaClient grafana.Client) *ELSyncCheck

NewELSyncCheck creates a new ELSyncCheck.

func (*ELSyncCheck) Category

func (c *ELSyncCheck) Category() Category

Category returns the category of the check.

func (*ELSyncCheck) ClientType

func (c *ELSyncCheck) ClientType() clients.ClientType

ClientType returns the client type of the check.

func (*ELSyncCheck) Name

func (c *ELSyncCheck) Name() string

Name returns the name of the check.

func (*ELSyncCheck) Run

func (c *ELSyncCheck) Run(ctx context.Context, log *logger.CheckLogger, cfg Config) (*Result, error)

Run executes the check.

type HeadSlotCheck

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

HeadSlotCheck is a check that verifies if the CL head slot is advancing.

func NewHeadSlotCheck

func NewHeadSlotCheck(grafanaClient grafana.Client) *HeadSlotCheck

NewHeadSlotCheck creates a new HeadSlotCheck.

func (*HeadSlotCheck) Category

func (c *HeadSlotCheck) Category() Category

Category returns the category of the check.

func (*HeadSlotCheck) ClientType

func (c *HeadSlotCheck) ClientType() clients.ClientType

ClientType returns the client type of the check.

func (*HeadSlotCheck) Name

func (c *HeadSlotCheck) Name() string

Name returns the name of the check.

func (*HeadSlotCheck) Run

func (c *HeadSlotCheck) Run(ctx context.Context, log *logger.CheckLogger, cfg Config) (*Result, error)

Run executes the check.

type Result

type Result struct {
	Name          string
	Category      Category
	Status        Status
	Description   string
	Timestamp     time.Time
	Details       map[string]interface{}
	AffectedNodes []string
}

Result represents the outcome of a health check.

type Runner

type Runner interface {
	// RegisterCheck adds a check to the runner.
	RegisterCheck(check Check)
	// RunChecks executes all registered checks.
	RunChecks(ctx context.Context) error
	// GetID returns the ID of the runner.
	GetID() string
	// GetLog returns the log of the runner.
	GetLog() *logger.CheckLogger
	// GetResults returns the results of the runner.
	GetResults() []*Result
	// GetAnalysis returns the analysis of the runner.
	GetAnalysis() *analyzer.AnalysisResult
}

Runner executes health checks.

func NewDefaultRunner

func NewDefaultRunner(cfg Config, cartographoor *cartographoor.Service) Runner

NewDefaultRunner creates a new default check runner.

type Status

type Status string

Status represents the status of a check.

const (
	StatusOK   Status = "OK"
	StatusFail Status = "FAIL"
)

Define the statuses.

Jump to

Keyboard shortcuts

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