metrics, core: add Prometheus metrics collector, add some metrics support#497
Merged
tungng98 merged 12 commits intoBuildOnViction:pre-releasefrom Jan 7, 2025
Merged
Conversation
metrics: add prometheus collector
metrics: add collector unit test, define TYPE only once
This was referenced Jan 2, 2025
Collaborator
|
LGTM |
tungng98
approved these changes
Jan 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a series of changes aimed at enhancing the metrics collection and reporting capabilities within the
tomoproject. 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:
MetricsEnabledFlag,MetricsEnabledExpensiveFlag,MetricsHTTPFlag, andMetricsPortFlagincmd/utils/flags.go.cmd/tomo/usage.go.Metrics Server Setup:
SetupMetricsfunction incmd/utils/flags.goto start the metrics export if enabled.internal/debug/flags.goto start a dedicated metrics server at the specified address, separate from the pprof server.Metrics Tracking:
Account and Storage Metrics:
core/blockchain.goandcore/state/state_object.go.StateDBstruct incore/state/statedb.goto include fields for tracking the duration of various operations.Metrics Reporting:
insertChainmethod incore/blockchain.goto report the collected metrics.core/state/statedb.goto measure and report the time spent on account and storage operations.These changes collectively improve the observability and performance monitoring of the
tomoproject by providing detailed metrics on critical operations.Reference: