app

package module
v0.0.0-...-828682c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 14 Imported by: 0

README

@eth-optimism/endpoint-monitor

The endpoint-monitor runs websocket checks on edge-proxyd endpoints and downstream infra provider endpoints.

Setup

Install go1.18

make build

source .env.example # (or copy to .envrc if using direnv)
./bin/endpoint-monitor

Documentation

Index

Constants

View Source
const (
	ProvidersFlagName     = "providers"
	CheckIntervalFlagName = "check-interval"
	CheckDurationFlagName = "check-duration"
)

Variables

View Source
var (
	MetricWsSubscribeStatus = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "ws_subscribe_status",
			Help: "eth_subscribe over websocket check status"},
		[]string{"status", "provider", "error"},
	)
)

Functions

func CLIFlags

func CLIFlags(envPrefix string) []cli.Flag

func Main

func Main(version string) func(cliCtx *cli.Context) error

Types

type Config

type Config struct {
	Providers     []string
	CheckInterval time.Duration
	CheckDuration time.Duration

	LogConfig     oplog.CLIConfig
	MetricsConfig opmetrics.CLIConfig
}

func NewConfig

func NewConfig(ctx *cli.Context) Config

func (Config) Check

func (c Config) Check() error

func (Config) GetProviderConfigs

func (c Config) GetProviderConfigs() []ProviderConfig

GetProviderConfigs fetches endpoint provider configurations from the environment Each provider should have a corresponding env var with the url, ex: PROVIDER1_URL=<provider-url>

type EndpointMonitor

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

func NewEndpointMonitor

func NewEndpointMonitor(cfg Config, l log.Logger) EndpointMonitor

func (EndpointMonitor) Start

func (e EndpointMonitor) Start()

type ProviderConfig

type ProviderConfig struct {
	Name string
	Url  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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