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

metrics, core: add Prometheus metrics collector, add some metrics support #497

Open
wants to merge 12 commits into
base: pre-release
Choose a base branch
from

Conversation

c98tristan
Copy link
Contributor

@c98tristan c98tristan commented Dec 25, 2024

This pull request introduces a series of changes aimed at enhancing the metrics collection and reporting capabilities within the tomo project. The updates include the addition of new metrics flags, the setup of a dedicated metrics server, and the tracking of various metrics related to account and storage operations.

Metrics Collection Enhancements:

  • New Metrics Flags:

    • Added new flags for enabling metrics collection and reporting, including MetricsEnabledFlag, MetricsEnabledExpensiveFlag, MetricsHTTPFlag, and MetricsPortFlag in cmd/utils/flags.go.
    • Grouped the new metrics flags under a "METRICS AND STATS" section in cmd/tomo/usage.go.
  • Metrics Server Setup:

    • Add Prometheus metrics collector, support collect metrics across the core blockchain.
    • Implemented a new SetupMetrics function in cmd/utils/flags.go to start the metrics export if enabled.
    • Modified internal/debug/flags.go to start a dedicated metrics server at the specified address, separate from the pprof server.

Metrics Tracking:

  • Account and Storage Metrics:

    • Added timers for tracking the time spent on account and storage operations in core/blockchain.go and core/state/state_object.go.
    • Updated the StateDB struct in core/state/statedb.go to include fields for tracking the duration of various operations.
  • Metrics Reporting:

    • Updated the insertChain method in core/blockchain.go to report the collected metrics.
    • Modified methods in core/state/statedb.go to measure and report the time spent on account and storage operations.

These changes collectively improve the observability and performance monitoring of the tomo project by providing detailed metrics on critical operations.

Reference:

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.

1 participant