0.1.4 Jul 5, 2022
0.1.3 Jul 1, 2022
0.1.1 Jun 6, 2022
0.1.0 May 26, 2022

#129 in #aptos


Used in debug-interface

Apache-2.0

165KB
3.5K SLoC

Metrics

Counters

Used to measure values that are added to over time, rates can then be used to check how quickly it changes in graphs. An example would be to add every time an incoming message occurs.

use prometheus::register_int_counter_vec;

register_int_counter_vec!(
    "name",
    "description",
    &["dimension_1", "dimension_2"]
);

Gauges

Used to measure values that change level over time. An example would be to set the number of connected peers.

use prometheus::register_int_gauge_vec;

register_int_gauge_vec!(
    "name",
    "description",
    &["dimension_1", "dimension_2"]
);

Histograms

Used to measure histogram values. An example is network connection latency.

use prometheus::register_histogram_vec;

register_histogram_vec!(
    "name",
    "description",
    &["dimension_1", "dimension_2"]
);

Dependencies

~125MB
~2.5M SLoC