Skip to content

Commit dad10ef

Browse files
docs: add metrics configuration (#468)
* docs: add metrics configuration * docs: rollkit metrics * docs: centralized sequencer page * docs: centralized sequencer metrics * docs: typo * docs: clarify config file; rewrite * doc: review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * docs: add to menu * docs: sidebar; heading * docs: fix config file path * docs: centralized sequencer metrics * docs: centralized-sequencer fmt * docs: centralized sequencer flags --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 8c1d255 commit dad10ef

File tree

4 files changed

+114
-0
lines changed

4 files changed

+114
-0
lines changed

.vitepress/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ function sidebarHome() {
338338
text: "Run a rollup full node",
339339
link: "/guides/full-node",
340340
},
341+
{
342+
text: "Run a centralized sequencer",
343+
link: "/guides/centralized-sequencer",
344+
},
341345
{
342346
text: "CometBFT into a Rollkit app",
343347
link: "/guides/cometbft-to-rollkit",
@@ -370,6 +374,10 @@ function sidebarHome() {
370374
text: "Use lazy sequencing (aggregation)",
371375
link: "/guides/lazy-sequencing",
372376
},
377+
{
378+
text: "Configure Prometheus metrics",
379+
link: "/guides/metrics",
380+
},
373381
],
374382
},
375383
{

guides/centralized-sequencer.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### Centralized Sequencer Node
2+
3+
The `centralized-sequencer` node implements a pluggable centralized sequencer scheme. It can be configured using the following flags:
4+
5+
| Flag | Usage | Default |
6+
|------------------------------|------------------------------------------------------------------|------------------------------|
7+
| `batch-time` | Time in seconds to wait before generating a new batch | `2` seconds |
8+
| `da_address` | DA address | `http://localhost:26658` |
9+
| `da_auth_token` | Auth token for the DA | `""` |
10+
| `da_namespace` | DA namespace where the sequencer submits transactions | `""` |
11+
| `host` | Centralized sequencer host | `localhost` |
12+
| `port` | Centralized sequencer port | `50051` |
13+
| `listen-all` | Listen on all network interfaces (0.0.0.0) instead of just localhost | disabled |
14+
| `metrics` | Enable Prometheus metrics | disabled |
15+
| `metrics-address` | Address to expose Prometheus metrics | `":8080"` |
16+
17+
See `centralized-sequencer --help` for details.
18+
19+
The `centralized-sequencer` node reports Prometheus metrics when the `-metrics` flag is enabled.
20+
21+
By default, metrics are exported to `http://localhost:8080/metrics`.
22+
23+
The listening address and port can be configured with the `-metrics-address` flag.
24+
25+
The following metrics are available:
26+
27+
| **Name** | **Type** | **Tags** | **Description** |
28+
|-------------------------------------------|-----------|-----------|------------------------------------------------------------------------|
29+
| sequencer_gas_price | Gauge | | Gas price of the DA transaction |
30+
| sequencer_last_blob_size | Gauge | | Last blob size submitted to the DA |
31+
| sequencer_transaction_status | Gauge | | Transaction status of the DA transaction |
32+
| sequencer_num_pending_blocks | Gauge | | Number of blocks pending DA submission |
33+
| sequencer_included_block_height | Gauge | | Block height of the last DA transaction |

guides/metrics.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# How to configure metrics
2+
3+
Rollkit can report and serve the Prometheus metrics, which in their turn can
4+
be consumed by Prometheus collector(s).
5+
6+
This functionality is disabled by default.
7+
8+
To enable the Prometheus metrics, set `instrumentation.prometheus=true` in your
9+
CometBFT node's [config file](https://docs.cometbft.com/v0.38/core/configuration)
10+
located at `$CMTHOME/config/config.toml`.
11+
12+
Metrics will be served under `/metrics` on 26660 port by default.
13+
The listening address (default: `localhost:26660`) can be changed in the config file using
14+
`instrumentation.prometheus_listen_addr`.
15+
16+
## List of available metrics
17+
18+
The following metrics are available, grouped by their subsystem:
19+
20+
### ABCI
21+
22+
| Name | Type | Tags | Description |
23+
|----------------------------------------------|-----------|-----------------------------|--------------------------------------------|
24+
| cometbft_abci_connection_method_timing_seconds | Histogram | chain_id, method, type | Timing for each ABCI method. |
25+
26+
### sequencer
27+
28+
| Name | Type | Tags | Description |
29+
|--------------------------------------|-------|----------|------------------------------|
30+
| cometbft_sequencer_height | Gauge | chain_id | Height of the chain. |
31+
| cometbft_sequencer_num_txs | Gauge | chain_id | Number of transactions. |
32+
| cometbft_sequencer_block_size_bytes | Gauge | chain_id | Size of the block. |
33+
| cometbft_sequencer_total_txs | Gauge | chain_id | Total number of transactions. |
34+
| cometbft_sequencer_latest_block_height | Gauge | chain_id | The latest block height. |
35+
36+
### mempool
37+
38+
| Name | Type | Tags | Description |
39+
|------------------------------------------|-----------|----------|--------------------------------------------------------------------------------|
40+
| cometbft_mempool_size | Gauge | chain_id | Size of the mempool (number of uncommitted transactions). |
41+
| cometbft_mempool_size_bytes | Gauge | chain_id | Total size of the mempool in bytes. |
42+
| cometbft_mempool_tx_size_bytes | Histogram | chain_id | Transaction sizes in bytes. |
43+
| cometbft_mempool_failed_txs | Counter | chain_id | Number of failed transactions. |
44+
| cometbft_mempool_rejected_txs | Counter | chain_id | Number of rejected transactions. |
45+
| cometbft_mempool_evicted_txs | Counter | chain_id | Number of evicted transactions. |
46+
| cometbft_mempool_recheck_times | Counter | chain_id | Number of times transactions are rechecked in the mempool. |
47+
48+
### p2p
49+
50+
| Name | Type | Tags | Description |
51+
|--------------------------------------|---------|---------------------|--------------------------------------------------|
52+
| cometbft_p2p_peers | Gauge | chain_id | Number of peers. |
53+
| cometbft_p2p_peer_receive_bytes_total| Counter | peer_id, chID | Number of bytes received from a given peer. |
54+
| cometbft_p2p_peer_send_bytes_total | Counter | peer_id, chID | Number of bytes sent to a given peer. |
55+
| cometbft_p2p_peer_pending_send_bytes | Gauge | peer_id | Pending bytes to be sent to a given peer. |
56+
| cometbft_p2p_num_txs | Gauge | peer_id | Number of transactions submitted by each peer. |
57+
| cometbft_p2p_message_receive_bytes_total | Counter | message_type | Number of bytes of each message type received. |
58+
| cometbft_p2p_message_send_bytes_total | Counter | message_type | Number of bytes of each message type sent. |
59+
60+
In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/master/dashboards) are exported as well.
61+
62+
### state
63+
64+
| Name | Type | Tags | Description |
65+
|--------------------------------------------|-----------|----------|--------------------------------------------------------------------------|
66+
| cometbft_state_block_processing_time | Histogram | chain_id | Time spent processing FinalizeBlock. |
67+
| cometbft_state_consensus_param_updates | Counter | chain_id | Number of consensus parameter updates returned by the application since process start. |
68+
69+
## centralized-sequencer
70+
71+
The `centralized-sequencer` has its own metrics and configuration, see the [centralized sequencer docs](guides/centralized-sequencer) for details.

guides/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ In this section, you'll find:
1818
* [Create genesis for your rollup](/guides/create-genesis)
1919
* [Restart your rollup](/guides/restart-rollup)
2020
* [Run a rollup full node](/guides/full-node)
21+
* [Run a centralized sequencer](/guides/centralized-sequencer)
2122
* [Turn your CometBFT app into a Rollkit app](/guides/cometbft-to-rollkit)
2223
* [Use Ignite to create a Rollkit app](/guides/ignite-rollkit)
2324
* Configuration
@@ -26,6 +27,7 @@ In this section, you'll find:
2627
* [Configure DA chain block sync time](/guides/da-block-time)
2728
* [Change speed of block production](/guides/block-times)
2829
* [Use lazy sequencing (aggregation)](/guides/lazy-sequencing)
30+
* [Configure Prometheus metrics](/guides/metrics)
2931
* Integrations
3032
* [Test and deploy cosmwasm smart-contracts](/guides/cw-orch)
3133
* [Add zkML to your EVM rollup](/guides/zkml)

0 commit comments

Comments
 (0)