...
- Counters -- these are the workhorse of the metrics system. These gather information on how many times some event occurs, or some piece of code is executed during a period of time. These can give you information on where most of the work is happening in the system.
- Range Samplers -- Not currently used in RNode
- Gauges -- Currently used to record numbers of peers (see comm/rp/Connect.scala and comm/discovery/KademliaNodeDiscovery.scala). In addition, a variety of information derived from the JVM is recorded using Gauges. These are collected in node/diagnostics/JvmMetrics.scala and use a wrapper called simply “g”.
- Histograms -- Currently used to record the amount of time to connect to a peer. See comm/rp/Connect.scala.
- Timers – Are not currently exposed in node/diagnostics/package.scala. Timers can record a start and stop time for an individual event.
- Spans – Are not currently exposed in node/diagnostics/package.scala. Spans are used to trace composite operations and the time it takes to perform them. Spans have the concept of parent and child spans.
Future Metrics Migration
As noted, Gauges are currently used in several places. Notably the JVM metrics. Since Gauges are an instantaneous snapshot, and suffer from the Nyquist problems mentioned above, we intend to migrate these to other Kamon metric types. Some will migrate to Counters. Metrics that cannot be expressed as a counter will migrate to either Histograms or Timers. Support for Timers will be added to node/diagnostics/package.scala.
...
Metrics that show how long some class of task takes to perform should use Timers. Support for them will be added in node/diagnostics/package.scala soon. See PR#1607. Examples of the use of Timers are time to process a transaction, achieve consensus on a block, ping times, or resource latency.
Spans
Prometheus
The Prometheus interface in RNode is created in node/diagnostics/NewPrometheusReporter.scala. Here, a singleton object is created, and a configuration file is read.
The default configuration file is docker/node/prometheus/prometheus.yml???.
Grafana
Configured by some combination of
...
docker/node/grafana/grafana.conf
docker/node/docker-compose.ymldocker/node/grafana/provisioning/dashboards/dashboard.yml
...
docker/node/grafana/provisioning/dashboards/rnode-metrics.json
controls what metrics are displayed on the Grafana dashboard
scripts/rnode-metric-counters-to-grafana-dash.sh