Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricName ¶
type MetricName string
MetricName
const ( TotalBlockScanned MetricName = `total_block_scanned` CurrentPosition MetricName = `current_position` TotalRetryBlocks MetricName = `total_retry_blocks` CommonBLockScannerError MetricName = `block_scanner_error` BinanceBlockScanError MetricName = `biance_block_scan_error` BlockWithoutTx MetricName = `block_no_tx` BlockWithTxIn MetricName = `block_tx_in` BlockNoTxIn MetricName = `block_no_tx_in` StateChainBlockScanError MetricName = `statechain_block_scan_error` BlockNoTxOut MetricName = `block_no_txout` BlockDiscoveryDuration MetricName = `block_discovery_duration` SearchTxDuration MetricName = `search_tx_duration` StateChainBridgeError MetricName = `statechain_bridge_error` TxToStateChain MetricName = `tx_to_statechain` TxToStateChainSigned MetricName = `tx_to_statechain_signed` SignToStateChainDuration MetricName = `sign_to_statechain_duration` SendToStatechainDuration MetricName = `send_to_statechain_duration` ObserverError MetricName = `observer_error` SignerError MetricName = `signer_error` TxToBinanceSigned MetricName = `tx_to_binance_signed` TxToBinanceSignedBroadcast MetricName = `tx_to_binance_broadcast` SignAndBroadcastToBinanceDuration MetricName = `sign_and_broadcast_to_binance_duration` PoolAddressManagerError MetricName = `pool_address_manager_error` )
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics used to provide promethus metrics
func NewMetrics ¶
func NewMetrics(cfg config.MetricConfiguration) (*Metrics, error)
NewMetrics create a new instance of Metrics
func (*Metrics) GetCounter ¶
func (m *Metrics) GetCounter(name MetricName) prometheus.Counter
GetCounter return a counter by name, if it doesn't exist, then it return nil
func (*Metrics) GetCounterVec ¶
func (m *Metrics) GetCounterVec(name MetricName) *prometheus.CounterVec
func (*Metrics) GetHistograms ¶
func (m *Metrics) GetHistograms(name MetricName) prometheus.Histogram
GetHistograms return a histogram by name
Click to show internal directories.
Click to hide internal directories.