Skip to content

Commit

Permalink
docs: add description of the prometheus metrics used in jormungandr
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Sep 27, 2023
1 parent 2a68afe commit 3b228b3
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions book/src/10_prometheus_metrics/00_description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# `jormungandr` Prometheus Metrics

`jormungadr` uses Prometheus metrics to gather information about the node at runtime.


Check failure on line 5 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Multiple consecutive blank lines [Expected: 1; Actual: 2]

book/src/10_prometheus_metrics/00_description.md:5 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
## Fragment Mempool Process

As the node receives fragments, they are inserted into the fragment mempool, and propagated into the peer network.

### `txRecvCnt`

Check failure on line 10 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `txRecvCnt`"]

book/src/10_prometheus_metrics/00_description.md:10 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `txRecvCnt`"]
>> tx_recv_cnt: IntCounter,

Total number of tx inserted and propagated by the mempool at each loop in the process.

### `txRejectedCnt`

Check failure on line 15 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `txRejectedCnt`"]

book/src/10_prometheus_metrics/00_description.md:15 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `txRejectedCnt`"]
>> tx_rejected_cnt: IntCounter,

Total number of tx rejected by the mempool at each loop in the process.

### `mempoolTxCount`

Check failure on line 20 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `mempoolTxCount`"]

book/src/10_prometheus_metrics/00_description.md:20 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `mempoolTxCount`"]
>> mempool_tx_count: UIntGauge,

Total number of tx in the mempool for a given block

### `mempoolUsageRatio`

Check failure on line 25 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `mempoolUsageRatio`"]

book/src/10_prometheus_metrics/00_description.md:25 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `mempoolUsageRatio`"]
>> mempool_usage_ratio: Gauge,

Mempool usage ratio for a given block


Check failure on line 30 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Multiple consecutive blank lines [Expected: 1; Actual: 2]

book/src/10_prometheus_metrics/00_description.md:30 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
## Topology Process

As the node connects to peers, the network topology allows for gossip and p2p communication. Nodes can join or leave the network.

### `peerConnectedCnt`

Check failure on line 35 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerConnectedCnt`"]

book/src/10_prometheus_metrics/00_description.md:35 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerConnectedCnt`"]
>> peer_connected_cnt: UIntGauge,

The total number of connected peers.

### `peerQuarantinedCnt`

Check failure on line 40 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerQuarantinedCnt`"]

book/src/10_prometheus_metrics/00_description.md:40 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerQuarantinedCnt`"]
>> peer_quarantined_cnt: UIntGauge,

The total number of quarantined peers.

### `peerAvailableCnt`

Check failure on line 45 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerAvailableCnt`"]

book/src/10_prometheus_metrics/00_description.md:45 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerAvailableCnt`"]
>> peer_available_cnt: UIntGauge,

The total number of available peers.

### `peerTotalCnt`

Check failure on line 50 in book/src/10_prometheus_metrics/00_description.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerTotalCnt`"]

book/src/10_prometheus_metrics/00_description.md:50 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### `peerTotalCnt`"]
>> peer_total_cnt: UIntGauge,

The total number of peers.


## Blockchain Process

Each node receives blocks streamed from the network which are processed in order to create a new block tip.

### `blockRecvCnt`
>> block_recv_cnt: IntCounter,

This is the total number of blocks streamed from the network that will be processed at each loop in the process.


## Blockchain Tip-Block Process

As the node sets the tip-block, this happens when the node is started and during the block minting process, these metrics are updated.

### `votesCasted`
>> votes_casted_cnt: IntCounter,

The total number accepted `VoteCast` fragments. Metric is incremented by the total number of valid `VoteCast` fragments in the block tip.

### `lastBlockTx`
>> // Total number of tx for a given block
>> block_tx_count: IntCounter,

The total number of valid transaction fragments in the block tip.

### `lastBlockInputTime` <--- **misnomer**
>> block_input_sum: UIntGauge,

The total sum of transaction input values in the block tip. The `tx.total_input()` is added for every fragment.

### `lastBlockSum`
>> block_fee_sum: UIntGauge,

The total sum of transaction output values (fees) in the block tip. The `tx.total_output()` is added for every fragment.

### `lastBlockContentSize`
>> block_content_size: UIntGauge,

The total size in bytes of the sum of the transaction content in the block tip.

### `lastBlockEpoch`
>> block_epoch: UIntGauge,

The epoch of the block date defined in the block tip header.

### `lastBlockSlot`
>> block_slot: UIntGauge,

The slot of the block date defined in the block tip header.

### `lastBlockHeight`
>> block_chain_length: UIntGauge,

Length of the blockchain.

### `lastBlockDate`
>> block_time: UIntGauge,

Timestamp in seconds of the block date.


## Unused metrics

### `lastReceivedBlockTime`
>> slot_start_time: UIntGauge,

This metric is never updated.


## Unclear metrics

### `lastBlockHashPiece`
>> block_hash: Vec<UIntGauge>,

A vector of gauges that does something to with the block hash. Metric is updated when `http_response` is called.

0 comments on commit 3b228b3

Please sign in to comment.