Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add metrics configuration #468

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

docs: add metrics configuration #468

wants to merge 13 commits into from

Conversation

tuxcanfly
Copy link
Contributor

@tuxcanfly tuxcanfly commented Sep 27, 2024

Overview

Fixes #431

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a section on configuring Prometheus metrics in the documentation.
    • Introduced a guide for running a centralized sequencer.
    • Listed available metrics with descriptions and types in the documentation.
  • Documentation

    • Enhanced navigation with new sidebar items for the centralized sequencer and Prometheus metrics.
    • Updated overview guide to include new entries for better user resource access.

Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Walkthrough

The changes involve updates to the Rollkit documentation, specifically enhancing the guides related to metrics and centralized sequencers. A new section on configuring Prometheus metrics was added to guides/metrics.md, detailing how to enable metrics reporting. The guides/centralized-sequencer.md file introduces the centralized sequencer node and its configuration options. Additionally, the sidebar structure in .vitepress/config.ts was modified to include links to these new guides, while guides/overview.md was updated to reflect the new entries.

Changes

File Change Summary
guides/metrics.md Added sections on "How to configure metrics" and "List of available metrics," including details on Prometheus metrics.
guides/centralized-sequencer.md Introduced a new section detailing the centralized sequencer node and its configuration flags, along with available metrics.
.vitepress/config.ts Updated sidebar to include "Run a centralized sequencer" and "Configure Prometheus metrics."
guides/overview.md Added new guide entries for "Run a centralized sequencer" and "Configure Prometheus metrics."

Assessment against linked issues

Objective Addressed Explanation
Document how to use Rollkit metrics (#431)

Suggested labels

documentation

Suggested reviewers

  • gupadhyaya
  • MSevey
  • yarikbratashchuk
  • jcstein

Poem

In the land of code where rabbits roam,
New metrics and guides make a cozy home.
With centralized sequencers now in sight,
We hop through the docs, feeling just right!
Prometheus metrics, oh what a delight,
Let’s gather our data, and take flight! 🐇📊


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
guides/metrics.md (3)

1-9: LGTM! Consider adding more context.

The introduction provides a clear and concise overview of Rollkit's Prometheus metrics functionality. To enhance user understanding, consider adding a brief explanation of why metrics are useful and how they can benefit users of Rollkit.


10-14: Remove unnecessary backslashes in config parameter.

The instructions for enabling metrics are clear. However, there's a minor formatting issue in the config parameter name.

Apply this change to line 13:

-`instrumentation.prometheus\_listen\_addr`).
+`instrumentation.prometheus_listen_addr`).

This removes the unnecessary backslashes, as Markdown doesn't require escaping underscores within backticks.

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


1-25: Expand documentation to fully address PR objectives.

While this document provides a good starting point for Rollkit metrics configuration, it could be expanded to fully meet the objectives outlined in issue #431. Consider adding the following sections to align more closely with the CometBFT metrics documentation:

  1. A brief introduction explaining the importance of metrics in Rollkit.
  2. More detailed configuration options, if available (e.g., setting custom ports, adjusting reporting intervals).
  3. Examples of how to query these metrics using Prometheus.
  4. Best practices for monitoring Rollkit using these metrics.
  5. Any known limitations or considerations when using metrics in Rollkit.

Adding these sections would provide a more comprehensive guide for users looking to leverage Rollkit metrics effectively.

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f8bc44c and 27bb078.

📒 Files selected for processing (1)
  • guides/metrics.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
guides/metrics.md

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)

🔇 Additional comments (1)
guides/metrics.md (1)

15-20: LGTM! Clear and well-structured table header.

The table header provides a clear structure for presenting the metrics information. It includes all necessary columns: Name, Type, Tags, and Description.

guides/metrics.md Outdated Show resolved Hide resolved
@MSevey
Copy link
Contributor

MSevey commented Sep 27, 2024

docs preview is failing: https://github.com/rollkit/docs/actions/runs/11072258066/job/30766061486?pr=468

but it looks like something broke it previously https://github.com/rollkit/docs/actions/workflows/preview.yml

Let's fix this so we can see how this update renders.

@MSevey
Copy link
Contributor

MSevey commented Sep 27, 2024

Tracking build failure here: #469

Copy link
Contributor

github-actions bot commented Sep 30, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://rollkit.github.io/docs-preview/./pr-468/
on branch main at 2024-10-22 23:58 UTC

guides/metrics.md Outdated Show resolved Hide resolved
Copy link
Contributor

@MSevey MSevey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page isn't linked to the site yet https://rollkit.github.io/docs-preview/pr-468/guides/overview

You need to add it to the menu.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (5)
learn/centralized-sequencer-node.md (3)

1-18: Enhance readability with minor formatting adjustments

The introduction and configuration table are informative and well-structured. Consider the following suggestions to improve clarity:

  1. Add a brief description of what a centralized sequencer is and its role in the system.
  2. Consider adding a blank line between the table header and the first row for better readability.
  3. Align the default values in the table for consistency.

Here's a suggested improvement for the table formatting:

| Flag             | Usage                                                    | Default                  |
|------------------|-------------------------------------------------------------|--------------------------|
| `batch-time`     | Time in seconds to wait before generating a new batch       | 2 seconds                |
| `da_address`     | DA address                                                  | `http://localhost:26658` |
| `da_auth_token`  | Auth token for the DA                                       | `""`                     |
| `da_namespace`   | DA namespace where the sequencer submits transactions       | `""`                     |
| `host`           | Centralized sequencer host                                  | localhost                |
| `port`           | Centralized sequencer port                                  | 50051                    |
| `listen-all`     | Listen on all network interfaces instead of just localhost  | disabled                 |
| `metrics`        | Enable Prometheus metrics                                   | disabled                 |
| `metrics-address`| Address to expose Prometheus metrics                        | `":8080"`                |

20-21: Improve metrics introduction formatting and grammar

The metrics introduction provides valuable information but could be improved for clarity:

  1. Consider using a bullet point list for better readability.
  2. There's a minor grammatical issue in the second sentence.

Here's a suggested improvement:

The `centralized-sequencer` node reports Prometheus metrics when the `-metrics` flag is enabled:

- By default, metrics are exported to `http://localhost:8080/metrics`.
- The listen address and port can be configured with the `-metrics-address` flag.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~20-~20: Did you mean: “By default,”?
Context: ...cs when the -metrics flag is enabled. By default metrics are exported to `http://localho...

(BY_DEFAULT_COMMA)


[grammar] ~21-~21: It looks like there is a word missing here. Did you mean “listen to address”?
Context: ...to http://localhost:8080/metrics, the listen address and port can be configured with `-metri...

(LISTEN_TO_ME)


1-31: Enhance document with additional context and usage information

The document provides valuable information about the Centralized Sequencer Node, its configuration, and metrics. To make it even more useful for users, consider adding the following:

  1. A brief conclusion or summary that ties together the configuration options and metrics.
  2. Information on how to interpret and use these metrics for monitoring and troubleshooting.
  3. Examples of common use cases or scenarios where these metrics would be particularly useful.
  4. Links to related documentation or resources for further reading.

Here's a suggested addition to the end of the document:

### Interpreting and Using Metrics

The provided metrics offer insights into the performance and status of your Centralized Sequencer Node:

- Use `gas_price` and `last_blob_size` to monitor resource usage and optimize costs.
- Track `transaction_status` and `num_pending_blocks` to identify potential bottlenecks or issues in the sequencing process.
- Monitor `included_block_height` to ensure your node is keeping up with the network.

For more information on optimizing your Centralized Sequencer Node and interpreting these metrics, refer to our [Advanced Monitoring Guide](link-to-guide).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~20-~20: Did you mean: “By default,”?
Context: ...cs when the -metrics flag is enabled. By default metrics are exported to `http://localho...

(BY_DEFAULT_COMMA)


[grammar] ~21-~21: It looks like there is a word missing here. Did you mean “listen to address”?
Context: ...to http://localhost:8080/metrics, the listen address and port can be configured with `-metri...

(LISTEN_TO_ME)

guides/metrics.md (2)

1-13: LGTM! Consider adding a configuration file example.

The "How to configure metrics" section provides clear and concise instructions for enabling and configuring Prometheus metrics in Rollkit. The information is accurate and helpful for users.

To further enhance this section, consider adding a small example snippet of the configuration file showing how to enable metrics and set the listen address. This would provide a concrete reference for users.

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


15-54: LGTM! Consider minor formatting improvements for consistency.

The "List of available metrics" section provides a comprehensive and well-structured table of available metrics. Each metric is clearly described with its name, type, tags, and description, which is very helpful for users.

To improve consistency and readability:

  1. Consider using consistent capitalization in the "Description" column. For example:

    • "Height of the chain" -> "Height of the chain"
    • "Number of validators" -> "Number of validators"
    • "Total voting power of all validators" -> "Total voting power of all validators"
  2. Ensure consistent use of periods at the end of descriptions. Currently, some descriptions end with periods while others don't.

These minor adjustments will enhance the overall presentation of the metrics table.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 27bb078 and 5230d42.

📒 Files selected for processing (2)
  • guides/metrics.md (1 hunks)
  • learn/centralized-sequencer-node.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
guides/metrics.md

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)

learn/centralized-sequencer-node.md

[uncategorized] ~20-~20: Did you mean: “By default,”?
Context: ...cs when the -metrics flag is enabled. By default metrics are exported to `http://localho...

(BY_DEFAULT_COMMA)


[grammar] ~21-~21: It looks like there is a word missing here. Did you mean “listen to address”?
Context: ...to http://localhost:8080/metrics, the listen address and port can be configured with `-metri...

(LISTEN_TO_ME)

🔇 Additional comments (1)
guides/metrics.md (1)

1-54: Great job on the metrics documentation!

This new file provides excellent documentation on configuring and using Prometheus metrics in Rollkit. The content is well-structured, informative, and easy to follow. It covers both the configuration process and a comprehensive list of available metrics, which will be very helpful for users implementing monitoring solutions.

The minor suggestions provided in the previous comments (adding a configuration example and improving formatting consistency) would further enhance the already high-quality document. Overall, this is a valuable addition to the Rollkit documentation.

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)

learn/centralized-sequencer-node.md Outdated Show resolved Hide resolved
guides/metrics.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (4)
learn/centralized-sequencer-node.md (1)

1-5: Consider enhancing the introduction section.

The introduction could benefit from additional context about when and why one would use a centralized sequencer node.

Consider adding a brief explanation of:

  • The purpose and benefits of using a centralized sequencer
  • Common use cases
  • How it differs from other sequencing approaches
guides/metrics.md (3)

11-13: Improve configuration documentation clarity.

Consider these improvements:

  1. Use consistent port number formatting (either "port 26660" or "26660 port")
  2. Fix the grammar in "Listen address" to "The listening address"
  3. Remove unnecessary backslashes in prometheus_listen_addr
-Metrics will be served under `/metrics` on 26660 port by default.
-Listen address can be changed in the config file (see
-`instrumentation.prometheus\_listen\_addr`).
+Metrics will be served under `/metrics` on port 26660 by default.
+The listening address can be changed in the config file (see
+`instrumentation.prometheus_listen_addr`).
🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


26-26: Improve metric description grammar.

Replace "amount of" with "number of" for countable items:

-| consensus_validator_missed_blocks       | Gauge     |                  | Total amount of blocks missed for the node, if the node is a validator |
+| consensus_validator_missed_blocks       | Gauge     |                  | Total number of blocks missed for the node, if the node is a validator |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)


19-54: Consider enhancing metric descriptions.

Some metric descriptions could be more informative:

  1. Add units where applicable (e.g., bytes, seconds)
  2. Clarify what "0" and "1" values mean for boolean gauges
  3. Add typical use cases or examples for complex metrics

For example:

-| consensus_block_size_bytes              | Gauge     |                  | Block size in bytes                                    |
+| consensus_block_size_bytes              | Gauge     |                  | Size of the current block in bytes (useful for monitoring chain growth) |
🧰 Tools
🪛 LanguageTool

[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5230d42 and 197784d.

📒 Files selected for processing (2)
  • guides/metrics.md (1 hunks)
  • learn/centralized-sequencer-node.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
guides/metrics.md

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


[uncategorized] ~26-~26: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ... | Gauge | | Total amount of blocks missed for the node, if the n...

(AMOUNTOF_TO_NUMBEROF)

learn/centralized-sequencer-node.md

[uncategorized] ~20-~20: Did you mean: “By default,”?
Context: ...cs when the -metrics flag is enabled. By default metrics are exported to `http://localho...

(BY_DEFAULT_COMMA)


[grammar] ~21-~21: It looks like there is a word missing here. Did you mean “listen to address”?
Context: ...to http://localhost:8080/metrics, the listen address and port can be configured with `-metri...

(LISTEN_TO_ME)

🔇 Additional comments (2)
learn/centralized-sequencer-node.md (1)

23-31: Enhance metrics table with additional context.

Consider adding:

  1. Example values or ranges for each metric
  2. When each metric is updated
  3. Grouping related metrics together (e.g., DA-related metrics vs block-related metrics)
guides/metrics.md (1)

10-11: Specify the configuration file location.

Previous reviewers were confused about which configuration file to use. Please specify the exact file name and location (e.g., ~/.rollkit/config/rollkit.toml or similar).

🧰 Tools
🪛 LanguageTool

[grammar] ~11-~11: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)

learn/centralized-sequencer-node.md Outdated Show resolved Hide resolved
learn/centralized-sequencer-node.md Outdated Show resolved Hide resolved
guides/metrics.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
guides/metrics.md (3)

18-21: Document the metrics list maintenance process.

Please add information about:

  1. Whether these metrics are from CometBFT core or Rollkit-specific
  2. How this list is maintained and updated
  3. Version compatibility of these metrics

Add a note at the beginning of the metrics list:

 The following metrics are available, grouped by their subsystem:
+
+> Note: This list includes both CometBFT core metrics and Rollkit-specific metrics.
+> It is manually maintained and corresponds to Rollkit version X.Y.Z.
+> When adding new metrics, please update this documentation accordingly.

32-36: Enhance sequencer metrics descriptions.

Consider adding more context to these metrics descriptions:

  • cometbft_sequencer_height: "Current height of the blockchain"
  • cometbft_sequencer_num_txs: "Number of transactions in the current block"
  • cometbft_sequencer_total_txs: "Total number of transactions processed since genesis"

62-62: Enhance go-libp2p metrics documentation.

Consider adding:

  1. A brief list of key go-libp2p metrics that are most relevant to Rollkit users
  2. The metrics prefix used by go-libp2p (to help users filter metrics)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 197784d and e5b6686.

📒 Files selected for processing (1)
  • guides/metrics.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
guides/metrics.md

[grammar] ~14-~14: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ...er /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)

🔇 Additional comments (2)
guides/metrics.md (2)

40-48: LGTM!

The mempool metrics are well-documented with clear and comprehensive descriptions.


66-69: LGTM!

The state metrics are well-documented with clear descriptions.

guides/metrics.md Outdated Show resolved Hide resolved
tuxcanfly and others added 4 commits October 22, 2024 14:58
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
guides/centralized-sequencer.md (1)

1-33: Consider adding sections to match CometBFT's documentation completeness.

To achieve parity with CometBFT's metrics documentation (https://docs.cometbft.com/v0.37/core/metrics), consider adding:

  1. Configuration examples showing different setups
  2. Instructions for setting up monitoring (e.g., with Prometheus)
  3. Grafana dashboard templates for visualizing metrics

Would you like me to help create these additional sections?

guides/metrics.md (6)

8-14: Improve configuration path and formatting.

A few minor improvements needed in the configuration section:

  1. Replace $CMTHOME with ~/.cometbft for consistency with CometBFT documentation
  2. Format the port number as inline code
-located at `$CMTHOME/config/config.toml`.
+located at `~/.cometbft/config/config.toml`.

-Metrics will be served under `/metrics` on 26660 port by default.
+Metrics will be served under `/metrics` on `26660` port by default.

16-18: Document metrics source and maintenance process.

Please add a note about:

  1. Which metrics are inherited from CometBFT/Cosmos SDK vs. Rollkit-specific
  2. How this list is maintained and updated
 The following metrics are available, grouped by their subsystem:
+
+> Note: This list includes metrics inherited from CometBFT and Rollkit-specific metrics.
+> For CometBFT's default metrics, see [CometBFT metrics documentation](https://docs.cometbft.com/v0.38/core/metrics).

20-25: Enhance ABCI metric description.

The description for cometbft_abci_connection_method_timing_seconds could be more informative.

-| cometbft_abci_connection_method_timing_seconds | Histogram | chain_id, method, type       | Timing for each ABCI method.               |
+| cometbft_abci_connection_method_timing_seconds | Histogram | chain_id, method, type       | Time taken to execute each ABCI method call in seconds. |

26-35: Improve sequencer metrics descriptions and formatting.

  1. Some descriptions could be more specific
  2. Remove extra spaces in table cells
-| cometbft_sequencer_height            | Gauge | chain_id | Height of the chain.          |
-| cometbft_sequencer_num_txs           | Gauge | chain_id | Number of transactions.       |
-| cometbft_sequencer_block_size_bytes  | Gauge | chain_id | Size of the block.            |
-| cometbft_sequencer_total_txs         | Gauge | chain_id | Total number of transactions. |
-| cometbft_sequencer_latest_block_height | Gauge | chain_id | The latest block height.      |
+| cometbft_sequencer_height | Gauge | chain_id | Current height of the blockchain |
+| cometbft_sequencer_num_txs | Gauge | chain_id | Number of transactions in the current block |
+| cometbft_sequencer_block_size_bytes | Gauge | chain_id | Size of the current block in bytes |
+| cometbft_sequencer_total_txs | Gauge | chain_id | Total number of transactions processed since start |
+| cometbft_sequencer_latest_block_height | Gauge | chain_id | Height of the most recently committed block |

48-60: Improve p2p metrics documentation.

  1. Use a versioned URL for go-libp2p dashboards
  2. Enhance some metric descriptions
-| cometbft_p2p_peers                   | Gauge   | chain_id            | Number of peers.                                 |
+| cometbft_p2p_peers                   | Gauge   | chain_id            | Number of currently connected peers               |

-In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/master/dashboards) are exported as well.
+In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/v0.x.y/dashboards) are exported as well.

69-71: Fix documentation link.

The link to the centralized sequencer documentation is missing the .md extension.

-The `centralized-sequencer` has its own metrics and configuration, see the [centralized sequencer docs](guides/centralized-sequencer) for details.
+The `centralized-sequencer` has its own metrics and configuration, see the [centralized sequencer docs](guides/centralized-sequencer.md) for details.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e5b6686 and 0904c55.

📒 Files selected for processing (4)
  • .vitepress/config.ts (2 hunks)
  • guides/centralized-sequencer.md (1 hunks)
  • guides/metrics.md (1 hunks)
  • guides/overview.md (2 hunks)
🧰 Additional context used
🔇 Additional comments (8)
guides/overview.md (2)

31-31: LGTM! Addition aligns with documentation requirements.

The metrics configuration guide entry is well-placed in the Configuration section and directly addresses the documentation needs outlined in issue #431. The format and structure are consistent with other configuration entries.

#!/bin/bash
# Verify that the metrics guide file exists and contains Prometheus configuration
fd "metrics.md$" guides/ --exec rg -l "Prometheus"

22-22: LGTM! Verify the guide link.

The placement and formatting of the centralized sequencer guide entry are consistent with the documentation structure.

✅ Verification successful

Let me verify the existence of the centralized sequencer guide with the correct filename pattern.


Link to centralized sequencer guide is valid and correctly placed

The guide file guides/centralized-sequencer.md exists in the repository, confirming that the link in the overview page is valid and points to an existing resource.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that the centralized sequencer guide file exists
fd "centralized-sequencer.md$" guides/

Length of output: 68


Script:

#!/bin/bash
# Verify that the centralized sequencer guide file exists (corrected pattern)
fd "centralized-sequencer.md$" guides/

# If not found, let's also check with hyphen vs underscore variation
fd "centralized_sequencer.md$" guides/

# Let's also do a broader search for any files containing "sequencer" in the guides directory
fd "sequencer" guides/

Length of output: 168

guides/centralized-sequencer.md (3)

25-33: Enhance metrics documentation with additional details.

The metrics table would benefit from:

  1. Remove or populate the empty "Tags" column.
  2. Add more detailed descriptions:
    • sequencer_transaction_status: Specify possible values/states
    • sequencer_gas_price: Include units
    • sequencer_last_blob_size: Specify units (bytes?)
  3. Add typical value ranges or alert thresholds where applicable.

Let's check for any additional metrics we might have missed:

#!/bin/bash
# Search for metric definitions in the codebase
ast-grep --pattern 'sequencer_$_'

1-17: Enhance configuration documentation with additional details and security considerations.

The configuration section would benefit from the following improvements:

  1. Explain what "pluggable centralized sequencer scheme" means for better user understanding.
  2. Add more details for configuration flags:
    • batch-time: Specify any minimum/maximum values or performance implications
    • da_namespace: Include format requirements or examples
    • da_auth_token: Add format requirements and security best practices
  3. Add a security warning for the listen-all flag about exposure risks.

Let's verify if there are any additional configuration flags we might have missed:


19-24: Add security considerations and usage details for metrics endpoint.

Consider enhancing the metrics configuration section with:

  1. Security recommendations for protecting the metrics endpoint in production.
  2. Information about the Prometheus metrics format and data types.
  3. Recommended scraping intervals and retention settings.

Let's check if there are any security-related configurations for metrics:

.vitepress/config.ts (3)

289-292: LGTM: Centralized sequencer guide entry is well-structured.

The addition follows the documentation's established patterns for guide entries, with clear text and consistent formatting.


325-328: LGTM: Metrics configuration guide entry addresses documentation requirements.

The addition is well-placed under the Configuration section and directly fulfills the requirements of issue #431 to document Rollkit metrics. The structure and formatting are consistent with other configuration entries.


289-292: Verify the existence of the new guide files.

Let's ensure that the referenced guide files exist in the repository:

Also applies to: 325-328

✅ Verification successful

Since the shell script results show that both guide files "guides/centralized-sequencer.md" and "guides/metrics.md" exist in the repository, I can now generate the final response:

Guide files verification completed successfully

Both referenced guide files exist in the repository:

  • ✓ guides/centralized-sequencer.md
  • ✓ guides/metrics.md
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new guide files exist

echo "Checking for new guide files..."
for guide in "guides/centralized-sequencer.md" "guides/metrics.md"; do
  if [ -f "$guide" ]; then
    echo "✓ Found: $guide"
  else
    echo "✗ Missing: $guide"
  fi
done

Length of output: 440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document how to use Rollkit metrics
4 participants