feat: document metrics, disable most libp2p metrics by default#5457
Merged
feat: document metrics, disable most libp2p metrics by default#5457
Conversation
added 2 commits
March 25, 2025 15:50
added 2 commits
March 25, 2025 15:58
hanabi1224
approved these changes
Mar 26, 2025
Contributor
Author
|
AFAIK, the removed metrics are not used by the infra team. |
| | `FOREST_TEST_RNG_FIXED_SEED` | non-negative integer | empty | 0 | Override RNG with a reproducible one seeded by the value. This should never be used out of test context for security. | | ||
| | `RUST_LOG` | string | empty | `debug,forest_libp2p::service=info` | Allows for log level customization. | | ||
| | `FOREST_IGNORE_DRAND` | 1 or true | empty | 1 | Ignore Drand validation. | | ||
| | `FOREST_LIBP2P_METRICS` | 1 or true | empty | 1 | Include `libp2p` metrics in Forest's Prometheus output. | |
Member
There was a problem hiding this comment.
Looking at other variables (at least newer ones), it seems the convention is to have a verb to make it more obvious,e.g., _OPT_OUT (here rather opt-in), _ENABLED etc.
src/libp2p/service.rs
Outdated
| } | ||
|
|
||
| const LIBP2P_METRICS: &str = "FOREST_LIBP2P_METRICS"; | ||
| fn enable_libp2p_metrics() -> bool { |
Member
There was a problem hiding this comment.
The name suggests the metrics are going to get enabled.
Suggested change
| fn enable_libp2p_metrics() -> bool { | |
| fn libp2p_metrics_enabled() -> bool { |
LesnyRumcajs
previously approved these changes
Mar 26, 2025
LesnyRumcajs
approved these changes
Mar 26, 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.
Summary of changes
Changes introduced in this pull request:
FOREST_LIBP2P_METRICSenv variable.Reference issue to close (if applicable)
Closes #5196 #3509
Other information and links
Change checklist