monitoring

package
v0.0.0-...-50c7a33 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnvelopeSourceFactory

func NewEnvelopeSourceFactory(
	ocr2Reader ocr2.OCR2Reader,
) relayMonitoring.SourceFactory

func NewMonitorPrometheusOnly

func NewMonitorPrometheusOnly(
	rootCtx context.Context,
	log commonMonitor.Logger,
	chainConfig commonMonitor.ChainConfig,
	envelopeSourceFactory commonMonitor.SourceFactory,
	txResultsSourceFactory commonMonitor.SourceFactory,
	feedsParser commonMonitor.FeedsParser,
	nodesParser commonMonitor.NodesParser,
) (*commonMonitor.Monitor, error)

Builds monitor instance with only the prometheus exporter. Does not contain kafka exporter.

func NewNodeBalancesExporterFactory

func NewNodeBalancesExporterFactory(log commonMonitoring.Logger, metrics Metrics) commonMonitoring.ExporterFactory

func NewNodeBalancesSourceFactory

func NewNodeBalancesSourceFactory(erc20Reader erc20.ERC20Reader) *nodeBalancesSourceFactory

func NewPrometheusExporterFactory

func NewPrometheusExporterFactory(
	metrics Metrics,
) relayMonitoring.ExporterFactory

NewPrometheusExporterFactory builds an implementation of the Exporter for prometheus.

func NewProxySourceFactory

func NewProxySourceFactory(
	ocr2Reader ocr2.OCR2Reader,
) relayMonitoring.SourceFactory

func NewTransmissionDetailsExporterFactory

func NewTransmissionDetailsExporterFactory(
	metrics Metrics,
) relayMonitoring.ExporterFactory

NewPrometheusExporterFactory builds an implementation of the Exporter for prometheus.

func NewTransmissionDetailsSourceFactory

func NewTransmissionDetailsSourceFactory(
	ocr2Reader ocr2.OCR2Reader,
) relayMonitoring.SourceFactory

func NewTxResultsSourceFactory

func NewTxResultsSourceFactory(
	ocr2Reader ocr2.OCR2Reader,
) relayMonitoring.SourceFactory

func StarknetFeedsParser

func StarknetFeedsParser(buf io.ReadCloser) ([]relayMonitoring.FeedConfig, error)

func StarknetNodesParser

func StarknetNodesParser(buf io.ReadCloser) ([]commonMonitoring.NodeConfig, error)

Types

type BalanceEnvelope

type BalanceEnvelope struct {
	Contracts []ContractAddressWithBalance
	Decimals  *big.Int
}

type ContractAddress

type ContractAddress struct {
	Address *felt.Felt
	Name    string
}

func NewContractAddress

func NewContractAddress(address string, name string) (ContractAddress, error)

type ContractAddressWithBalance

type ContractAddressWithBalance struct {
	ContractAddress
	Balance *big.Int
}

type Metrics

type Metrics interface {
	SetReportObservations(answer float64, accountAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)
	CleanupReportObservations(accountAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)
	SetProxyAnswersRaw(answer float64, proxyContractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)
	SetProxyAnswers(answer float64, proxyContractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)
	CleanupProxy(proxyContractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)
	SetBalance(answer float64, contractAddress, alias, networkId, networkName, chainID string)
	CleanupBalance(contractAddress, alias, networkId, networkName, chainID string)
}

Metrics is an interface for prometheus metrics. Makes testing easier.

func NewMetrics

func NewMetrics(log relayMonitoring.Logger) Metrics

NewMetrics does wisott

type MyConfig

type MyConfig = config.Config

func ParseWithoutKafka

func ParseWithoutKafka() (MyConfig, error)

type ProxyData

type ProxyData struct {
	Answer *big.Int
}

type StarknetConfig

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

func ParseStarknetConfig

func ParseStarknetConfig() (StarknetConfig, error)

func (StarknetConfig) GetChainID

func (s StarknetConfig) GetChainID() string

func (StarknetConfig) GetLinkTokenAddress

func (s StarknetConfig) GetLinkTokenAddress() string

func (StarknetConfig) GetNetworkID

func (s StarknetConfig) GetNetworkID() string

func (StarknetConfig) GetNetworkName

func (s StarknetConfig) GetNetworkName() string

func (StarknetConfig) GetPollInterval

func (s StarknetConfig) GetPollInterval() time.Duration

func (StarknetConfig) GetRPCApiKey

func (s StarknetConfig) GetRPCApiKey() string

func (StarknetConfig) GetRPCEndpoint

func (s StarknetConfig) GetRPCEndpoint() string

func (StarknetConfig) GetReadTimeout

func (s StarknetConfig) GetReadTimeout() time.Duration

func (StarknetConfig) GetStrkTokenAddress

func (s StarknetConfig) GetStrkTokenAddress() *felt.Felt

func (StarknetConfig) ToMapping

func (s StarknetConfig) ToMapping() map[string]interface{}

type StarknetFeedConfig

type StarknetFeedConfig struct {
	Name           string   `json:"name,omitempty"`
	Path           string   `json:"path,omitempty"`
	Symbol         string   `json:"symbol,omitempty"`
	HeartbeatSec   int64    `json:"heartbeat,omitempty"`
	ContractType   string   `json:"contract_type,omitempty"`
	ContractStatus string   `json:"status,omitempty"`
	MultiplyRaw    string   `json:"multiply,omitempty"`
	Multiply       *big.Int `json:"-"`

	ContractAddress string `json:"contract_address,omitempty"`
	ProxyAddress    string `json:"proxy_address,omitempty"`
}

func (StarknetFeedConfig) GetContractAddress

func (s StarknetFeedConfig) GetContractAddress() string

func (StarknetFeedConfig) GetContractAddressBytes

func (s StarknetFeedConfig) GetContractAddressBytes() []byte

func (StarknetFeedConfig) GetContractStatus

func (s StarknetFeedConfig) GetContractStatus() string

func (StarknetFeedConfig) GetContractType

func (s StarknetFeedConfig) GetContractType() string

func (StarknetFeedConfig) GetFeedPath

func (s StarknetFeedConfig) GetFeedPath() string

func (StarknetFeedConfig) GetHeartbeatSec

func (s StarknetFeedConfig) GetHeartbeatSec() int64

func (StarknetFeedConfig) GetID

func (s StarknetFeedConfig) GetID() string

GetID returns the state account's address as that uniquely identifies a feed on Starknet. In Starknet, a program is stateless and we use the same program for all feeds so we can't use the program account's address.

func (StarknetFeedConfig) GetMultiply

func (s StarknetFeedConfig) GetMultiply() *big.Int

func (StarknetFeedConfig) GetName

func (s StarknetFeedConfig) GetName() string

func (StarknetFeedConfig) GetPath

func (s StarknetFeedConfig) GetPath() string

func (StarknetFeedConfig) GetSymbol

func (s StarknetFeedConfig) GetSymbol() string

func (StarknetFeedConfig) ToMapping

func (s StarknetFeedConfig) ToMapping() map[string]interface{}

type StarknetNodeConfig

type StarknetNodeConfig struct {
	ID          string   `json:"id,omitempty"`
	NodeAddress []string `json:"nodeAddress,omitempty"`
}

func (StarknetNodeConfig) GetAccount

func (s StarknetNodeConfig) GetAccount() types.Account

func (StarknetNodeConfig) GetName

func (s StarknetNodeConfig) GetName() string

type TransmissionInfo

type TransmissionInfo struct {
	GasPrice          *big.Int
	ObservationLength uint32
}

type TransmissionsEnvelope

type TransmissionsEnvelope struct {
	Transmissions []TransmissionInfo
}

Jump to

Keyboard shortcuts

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