Documentation
¶
Index ¶
Constants ¶
const ( // AppNamespace is the metric namespace. AppNamespace = "app" TickerLabel = "ticker" InclusionLabel = "included" ProviderLabel = "provider" StatusLabel = "status" ABCIMethodLabel = "abci_method" ChainIDLabel = "chain_id" ABCIMethodStatusLabel = "abci_method_status" MessageTypeLabel = "message_type" ValidatorLabel = "validator" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ABCIMethod ¶
type ABCIMethod int
ABCIMethod is an identifier for ABCI methods, this is used to paginate latencies / responses in prometheus metrics.
const ( PrepareProposal ABCIMethod = iota ProcessProposal ExtendVote VerifyVoteExtension PreBlock )
func (ABCIMethod) String ¶
func (a ABCIMethod) String() string
type Labeller ¶
type Labeller interface {
Label() string
}
Labeller is an interface that can be implemented by errors to provide a label for prometheus metrics.
func StatusFromError ¶
StatusFromError returns a Labeller that can be used to label metrics based on the error. This is used to label metrics based on the error returned from oracle client requests.
type MessageType ¶
type MessageType int
MessageType is an identifier used to represent the different types of data that is transmitted between validators in Connect. This ID is used to paginate metrics corresponding to these messages.
const ( ExtendedCommit MessageType = iota VoteExtension )
func (MessageType) String ¶
func (m MessageType) String() string
type Metrics ¶
type Metrics interface { // ObserveOracleResponseLatency records the time it took for the oracle to respond (this is a histogram) ObserveOracleResponseLatency(duration time.Duration) // AddOracleResponse increments the number of oracle responses, this can represent a liveness counter. This metric is paginated by status. AddOracleResponse(status Labeller) // ObserveABCIMethodLatency reports the given latency (as a duration), for the given ABCIMethod, and updates the ABCIMethodLatency histogram w/ that value. ObserveABCIMethodLatency(method ABCIMethod, duration time.Duration) // AddABCIRequest updates a counter corresponding to the given ABCI method and status. AddABCIRequest(method ABCIMethod, status Labeller) // ObserveMessageSize updates a histogram per Connect message type with the size of that message ObserveMessageSize(msg MessageType, size int) // ObservePriceForTicker updates a gauge with the price for the given ticker, this is updated each time a price is written to state ObservePriceForTicker(ticker connecttypes.CurrencyPair, price float64) // AddValidatorPriceForTicker updates a gauge per validator with the price they observed for a given ticker, this is updated when prices // to be written to state are aggregated AddValidatorPriceForTicker(validator string, ticker connecttypes.CurrencyPair, price float64) // AddValidatorReportForTicker updates a counter per validator + status. This counter represents the number of times a validator // for a ticker with a price, w/o a price, or w/ an absent. AddValidatorReportForTicker(validator string, ticker connecttypes.CurrencyPair, status ReportStatus) }
func NewMetrics ¶
func NewMetricsFromConfig ¶
NewMetricsFromConfig returns a new Metrics implementation based on the config. The Metrics returned is safe to be used in the client, and in the Oracle used by the PreBlocker. If the metrics are not enabled, a nop implementation is returned.
func NewNopMetrics ¶
func NewNopMetrics() Metrics
NewNopMetrics returns a Metrics implementation that does nothing.
type ReportStatus ¶
type ReportStatus int
ReportStatus is an identifier for the status of a report, this is used to label what kind of report a validator has given, i.e. absent, missing_price, with_price.
const ( Absent ReportStatus = iota MissingPrice WithPrice )
func (ReportStatus) String ¶
func (rs ReportStatus) String() string