Skip to content
Cosmopediaby Unity Nodes
DocumentationCometBFT ADRs and RFCscometbft/cometbft › docs › references › architecture › tendermint-coreView on CometBFT ADRs and RFCs ↗

ADR 011: Monitoring

ADR 011: Monitoring

Changelog

08-06-2018: Initial draft 11-06-2018: Reorg after @xla comments 13-06-2018: Clarification about usage of labels

Context

In order to bring more visibility into Tendermint, we would like it to report metrics and, maybe later, traces of transactions and RPC queries. See https://github.com/tendermint/tendermint/issues/986.

A few solutions were considered:

  1. Prometheus a) Prometheus API b) go-kit metrics package as an interface plus Prometheus c) telegraf d) new service, which will listen to events emitted by pubsub and report metrics
  2. OpenCensus

1. Prometheus

Prometheus seems to be the most popular product out there for monitoring. It has a Go client library, powerful queries, alerts.

a) Prometheus API

We can commit to using Prometheus in Tendermint, but I think Tendermint users should be free to choose whatever monitoring tool they feel will better suit their needs (if they don't have existing one already). So we should try to abstract interface enough so people can switch between Prometheus and other similar tools.

b) go-kit metrics package as an interface

metrics package provides a set of uniform interfaces for service instrumentation and offers adapters to popular metrics packages:

https://godoc.org/github.com/go-kit/kit/metrics#pkg-subdirectories

Comparing to Prometheus API, we're losing customisability and control, but gaining freedom in choosing any instrument from the above list given we will extract metrics creation into a separate function (see "providers" in node/node.go).

c) telegraf

Unlike already discussed options, telegraf does not require modifying Tendermint source code. You create something called an input plugin, which polls Tendermint RPC every second and calculates the metrics itself.

While it may sound good, but some metrics we want to report are not exposed via RPC or pubsub, therefore can't be accessed externally.

d) service, listening to pubsub

Same issue as the above.

2. opencensus

opencensus provides both metrics and tracing, which may be important in the future. It's API looks different from go-kit and Prometheus, but looks like it covers everything we need.

Unfortunately, OpenCensus go client does not define any interfaces, so if we want to abstract away metrics we will need to write interfaces ourselves.

List of metrics

NameTypeDescription
Aconsensus_heightGauge
Aconsensus_validatorsGaugeNumber of validators who signed
Aconsensus_validators_powerGaugeTotal voting power of all validators
Aconsensus_missing_validatorsGaugeNumber of validators who did not sign
Aconsensus_missing_validators_powerGaugeTotal voting power of the missing validators
Aconsensus_byzantine_validatorsGaugeNumber of validators who tried to double sign
Aconsensus_byzantine_validators_powerGaugeTotal voting power of the byzantine validators
Aconsensus_block_intervalTimingTime between this and last block (Block.Header.Time)
consensus_block_timeTimingTime to create a block (from creating a proposal to commit)
consensus_time_between_blocksTimingTime between committing last block and (receiving proposal creating proposal)
Aconsensus_roundsGaugeNumber of rounds
consensus_prevotesGauge
consensus_precommitsGauge
consensus_prevotes_total_powerGauge
consensus_precommits_total_powerGauge
Aconsensus_num_txsGauge
Amempool_sizeGauge
Aconsensus_total_txsGauge
Aconsensus_block_sizeGaugeIn bytes
Ap2p_peersGaugeNumber of peers node's connected to

A - will be implemented in the fist place.

Proposed solution

Status

Implemented

Consequences

Positive

Better visibility, support of variety of monitoring backends

Negative

One more library to audit, messing metrics reporting code with business domain.

Neutral