Documentation ¶
Index ¶
- Constants
- type ApplicationInfo
- type Chain
- type Client
- type Config
- type Diagnostics
- type Peer
- type Registry
- func (r *Registry) ObserveApplicationSource(application string, inputs map[string]Source)
- func (r *Registry) ObserveBtcConnectivity(btcChain bitcoin.Chain, tick time.Duration)
- func (r *Registry) ObserveConnectedBootstrapCount(netProvider net.Provider, bootstraps []string, tick time.Duration)
- func (r *Registry) ObserveConnectedPeersCount(netProvider net.Provider, tick time.Duration)
- func (r *Registry) ObserveEthConnectivity(blockCounter chain.BlockCounter, tick time.Duration)
- func (r *Registry) RegisterApplicationSource(application string, fetchApplicationDiagnostics func() ApplicationInfo)
- func (r *Registry) RegisterBtcChainInfoSource(btcChain bitcoin.Chain)
- func (r *Registry) RegisterClientInfoSource(netProvider net.Provider, signing chain.Signing, clientVersion string, ...)
- func (r *Registry) RegisterConnectedPeersSource(netProvider net.Provider, signing chain.Signing)
- func (r *Registry) RegisterEthChainInfoSource(blockCounter chain.BlockCounter)
- func (r *Registry) RegisterMetricClientInfo(version string)
- type Source
Constants ¶
const ( ConnectedPeersCountMetricName = "connected_peers_count" ConnectedBootstrapCountMetricName = "connected_bootstrap_count" EthConnectivityMetricName = "eth_connectivity" BtcConnectivityMetricName = "btc_connectivity" ClientInfoMetricName = "client_info" )
Names under which metrics are exposed.
const ( // DefaultNetworkMetricsTick is the default duration of the // observation tick for network metrics. DefaultNetworkMetricsTick = 1 * time.Minute // DefaultEthereumMetricsTick is the default duration of the // observation tick for Ethereum metrics. DefaultEthereumMetricsTick = 10 * time.Minute // DefaultBitcoinMetricsTick is the default duration of the // observation tick for Bitcoin metrics. DefaultBitcoinMetricsTick = 10 * time.Minute // The duration of the observation tick for all application-specific // metrics. ApplicationMetricsTick = 1 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationInfo ¶
type ApplicationInfo map[string]interface{}
ApplicationInfo describes data structure of application information.
type Chain ¶
type Chain struct {
LatestBlockNumber uint `json:"latest_block_number"`
}
Chain describes data structure of a chain information.
type Client ¶
type Client struct { ChainAddress string `json:"chain_address"` NetworkID string `json:"network_id"` Version string `json:"version"` Revision string `json:"revision"` }
Client describes data structure of client information.
type Config ¶
type Config struct { Port int NetworkMetricsTick time.Duration EthereumMetricsTick time.Duration BitcoinMetricsTick time.Duration }
Config stores configuration for the client info.
type Diagnostics ¶
type Diagnostics struct { ClientInfo Client `json:"client_info"` ConnectedPeers []Peer `json:"connected_peers"` EthChainInfo Chain `json:"eth_chain_info"` BtcChainInfo Chain `json:"btc_chain_info"` }
Diagnostics describes data structure returned by the diagnostics endpoint.
type Peer ¶
type Peer struct { ChainAddress string `json:"chain_address"` NetworkID string `json:"network_id"` NetworkMultiAddresses []string `json:"multiaddrs"` }
Peer describes data structure of peer information.
type Registry ¶
type Registry struct { *clientinfo.Registry // contains filtered or unexported fields }
Registry wraps keep-common clientinfo registry and exposes additional functions for registering client-custom metrics and diagnostics
func Initialize ¶
Initialize set up the client info registry and enables metrics and diagnostics server.
func (*Registry) ObserveApplicationSource ¶
ObserveApplicationSource triggers an observation process of application-specific metrics.
func (*Registry) ObserveBtcConnectivity ¶
ObserveBtcConnectivity triggers an observation process of the btc_connectivity metric.
func (*Registry) ObserveConnectedBootstrapCount ¶
func (r *Registry) ObserveConnectedBootstrapCount( netProvider net.Provider, bootstraps []string, tick time.Duration, )
ObserveConnectedBootstrapCount triggers an observation process of the connected_bootstrap_count metric.
func (*Registry) ObserveConnectedPeersCount ¶
ObserveConnectedPeersCount triggers an observation process of the connected_peers_count metric.
func (*Registry) ObserveEthConnectivity ¶
func (r *Registry) ObserveEthConnectivity( blockCounter chain.BlockCounter, tick time.Duration, )
ObserveEthConnectivity triggers an observation process of the eth_connectivity metric.
func (*Registry) RegisterApplicationSource ¶
func (r *Registry) RegisterApplicationSource( application string, fetchApplicationDiagnostics func() ApplicationInfo, )
RegisterApplicationSource registers the diagnostics source providing information about the application.
func (*Registry) RegisterBtcChainInfoSource ¶
RegisterBtcChainInfoSource registers the diagnostics source providing information about btc chain.
func (*Registry) RegisterClientInfoSource ¶
func (r *Registry) RegisterClientInfoSource( netProvider net.Provider, signing chain.Signing, clientVersion string, clientRevision string, )
RegisterClientInfoSource registers the diagnostics source providing information about the client itself.
func (*Registry) RegisterConnectedPeersSource ¶
RegisterConnectedPeersSource registers the diagnostics source providing information about connected peers.
func (*Registry) RegisterEthChainInfoSource ¶
func (r *Registry) RegisterEthChainInfoSource( blockCounter chain.BlockCounter, )
RegisterEthChainInfoSource registers the diagnostics source providing information about eth chain.
func (*Registry) RegisterMetricClientInfo ¶
RegisterMetricClientInfo registers static client information labels for metrics.