Documentation ¶
Index ¶
- Constants
- Variables
- func BuildPackageLabels(p Packager) prometheus.Labels
- func BuildPackageLabelsWithURL(p Packager, url string) prometheus.Labels
- func BuildRootLabels(p Packager) prometheus.Labels
- type ClientType
- type CollectorLoop
- type CollectorStart
- type CommonApp
- type CommonClient
- func (c *CommonClient) GetAPIEndPoint() string
- func (c *CommonClient) GetGRPCEndPoint() string
- func (c *CommonClient) GetRPCEndPoint() string
- func (c *CommonClient) SetAPIEndPoint(endpoint string) *resty.Client
- func (c *CommonClient) SetGRPCEndPoint(endpoint string) *resty.Client
- func (c *CommonClient) SetRPCEndPoint(endpoint string) *resty.Client
- type Endpoints
- type Exporter
- type ICollector
- type IIndexer
- type Indexer
- type IndexerDB
- type IndexerDBConfig
- type Method
- type Mode
- type OptionPackager
- type Packager
- func (p *Packager) SetAddtionalEndpoints(providerEndpoints Endpoints) *Packager
- func (p *Packager) SetConsumer() *Packager
- func (p *Packager) SetIndexerDB(idxDB *IndexerDB) *Packager
- func (p *Packager) SetInfoForBalancePackage(balanceAddresses []string, balanceDenom string, balanceExponent int) *Packager
Constants ¶
View Source
const ( Namespace = "cvms" // cosmos_validator_monitoring_service Subsystem = "root" // root subsytem for skip, health, ops Timeout = 13 * time.Second // root timeout for each package api call IndexerSQLDefaultTimeout = 10 * time.Second )
View Source
const ( IndexPointerBlockHeightMetricName = "latest_index_pointer_block_height" IndexPointerBlockTimestampMetricName = "latest_index_pointer_block_timestamp" LatestBlockHeightMetricName = "latest_block_height" RecentMissCounterMetricName = "recent_miss_counter" )
metrics name for indexer
View Source
const ( // labels for common ChainLabel = "chain" ChainIDLabel = "chain_id" TableChainIDLabel = "table_chain_id" PackageLabel = "package" BaseURLLabel = "endpoint" ErrLabel = "err" MainnetLabel = "mainnet" // labels for packages ValidatorAddressLabel = "validator_opeartor_address" ConsensusAddressLabel = "validator_consensus_address" MonikerLabel = "moniker" ProposerAddressLabel = "proposer_address" EvmChainLabel = "evm_chain" OrchestratorAddressLabel = "orchestrator_address" BalanceAddressLabel = "balance_address" UpgradeNameLabel = "upgrade_name" )
View Source
const ErrorPrefix = "cvms common errors"
Variables ¶
View Source
var ( ErrFailedToBuildPackager = errors.New("failed to build the packger").Error() ErrUnDefinedSomeConfiguration = errors.New("undefinded port or something in your prometheus config file") ErrUnDefinedApp = fmt.Errorf("%s: undefinded app name", ErrorPrefix) ErrUnSupportedPackage = fmt.Errorf("%s: this is unsupported monitoring package", ErrorPrefix) ErrUnSupportedMethod = fmt.Errorf("%s: this is unsupported method", ErrorPrefix) ErrUnsetHttpSchema = fmt.Errorf("%s: failed to unset http schema for grpc connecting", ErrorPrefix) ErrFailedHttpRequest = fmt.Errorf("%s: failed to request from node", ErrorPrefix) ErrGotStrangeStatusCode = fmt.Errorf("%s: got strange status code in request", ErrorPrefix) ErrUnExpectedMethodCall = fmt.Errorf("%s: got unexpected call method", ErrorPrefix) ErrFailedJsonUnmarshal = fmt.Errorf("%s: failed to unmarshing json data", ErrorPrefix) ErrFailedConvertTypes = fmt.Errorf("%s: failed to converting number types", ErrorPrefix) ErrOutOfSwitchCases = fmt.Errorf("%s: out of switch case in router", ErrorPrefix) ErrFailedGatheringMiddleData = fmt.Errorf("%s: failed to gather middle data like orchestrator address or somethings", ErrorPrefix) ErrFailedCreateGrpcConnection = fmt.Errorf("%s: failed to create grpc connection", ErrorPrefix) ErrFailedGrpcRequest = fmt.Errorf("%s: failed to grpc request from node", ErrorPrefix) ErrFailedBuildingLogger = fmt.Errorf("%s: failed to build logger by not found workspace string", ErrorPrefix) )
View Source
var ( // moniker is filter for ce Moniker string DefaultLabels = []string{ChainLabel, ChainIDLabel, PackageLabel, MainnetLabel, ErrLabel} // root skip counter for increasing count if any package is failed Skip = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Subsystem: Subsystem, Name: "skip_counter"}, DefaultLabels, ) Health = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Subsystem: Subsystem, Name: "health_checker"}, DefaultLabels, ) Ops = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Subsystem: Subsystem, Name: "processed_ops_total"}, DefaultLabels, ) )
View Source
var ( IndexPackages = []string{ "voteindexer", "veindexer", } ExporterPackages = []string{ "block", "uptime", "balance", "upgrade", "axelar-evm", "eventnonce", "oracle", "yoda", } )
View Source
var ErrCanSkip = fmt.Errorf("skip")
Functions ¶
func BuildPackageLabels ¶
func BuildPackageLabels(p Packager) prometheus.Labels
func BuildPackageLabelsWithURL ¶
func BuildPackageLabelsWithURL(p Packager, url string) prometheus.Labels
func BuildRootLabels ¶
func BuildRootLabels(p Packager) prometheus.Labels
Types ¶
type CollectorLoop ¶
type CommonApp ¶
type CommonApp struct { CommonClient EndPoint string // optional client OptionalClient CommonClient }
func NewCommonApp ¶
type CommonClient ¶
type CommonClient struct { RPCClient *resty.Client APIClient *resty.Client GRPCClient *resty.Client *logrus.Entry }
func NewOptionalClient ¶
func NewOptionalClient(entry *logrus.Entry) CommonClient
func (*CommonClient) GetAPIEndPoint ¶
func (c *CommonClient) GetAPIEndPoint() string
func (*CommonClient) GetGRPCEndPoint ¶
func (c *CommonClient) GetGRPCEndPoint() string
func (*CommonClient) GetRPCEndPoint ¶
func (c *CommonClient) GetRPCEndPoint() string
func (*CommonClient) SetAPIEndPoint ¶
func (c *CommonClient) SetAPIEndPoint(endpoint string) *resty.Client
func (*CommonClient) SetGRPCEndPoint ¶
func (c *CommonClient) SetGRPCEndPoint(endpoint string) *resty.Client
func (*CommonClient) SetRPCEndPoint ¶
func (c *CommonClient) SetRPCEndPoint(endpoint string) *resty.Client
type Exporter ¶
func NewExporter ¶
type IIndexer ¶
type IIndexer interface { Start() error Loop(lastIndexPointerHeight int64) FetchValidatorInfoList() error }
TODO: All Methods in VoteIndexer, we need to add here?
type Indexer ¶
type Indexer struct { CommonApp ChainName string Mainnet bool ChainID string ChainInfoID int64 ProtocolType string IsConsumer bool Monikers []string MonikerIDMap indexertypes.MonikerIDMap Endpoints *IndexerDB Vim indexertypes.ValidatorIDMap Lh indexertypes.LatestHeightCache Factory promauto.Factory MetricsMap map[string]prometheus.Gauge MetricsVecMap map[string]*prometheus.GaugeVec RootLabels prometheus.Labels PackageLabels prometheus.Labels }
func NewIndexer ¶
TODO: not implemented
func (*Indexer) FetchLatestHeight ¶
func (indexer *Indexer) FetchLatestHeight()
type IndexerDB ¶
func NewIndexerDB ¶
func NewIndexerDB(cfg IndexerDBConfig) (*IndexerDB, error)
func NewTestIndexerDB ¶
func (*IndexerDB) SetRetentionTime ¶
type IndexerDBConfig ¶
type OptionPackager ¶
type Packager ¶
type Packager struct { Mode Mode Logger *logrus.Logger Factory promauto.Factory ChainName string Mainnet bool ChainID string Package string ProtocolType string Endpoints // optional info by mode Monikers []string // optional info by package OptionPackager }
func NewPackager ¶
func (*Packager) SetAddtionalEndpoints ¶
func (*Packager) SetConsumer ¶
func (*Packager) SetIndexerDB ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.