Open rymnc opened 2 weeks ago
At the moment, all metrics definitions live in https://github.com/FuelLabs/fuel-core/tree/master/crates/metrics, and are used in modules differently.
For example, the rocks_db metrics, are updated as-is with no way for the operator to "opt-in" to this metric collection, shown in an example here - https://github.com/FuelLabs/fuel-core/blob/9f96573224056aa5a11233b821d34cb8ae4fad20/crates/fuel-core/src/state/rocks_db.rs#L551-L555
rocks_db
furthermore, out of all the modules that use metrics, only 3 modules make use of the cli argument --metrics to disable/enable metrics collection, which are block_producer, txpool, and p2p. Please note that block_producer has no metrics, but still takes in the metrics flag and does nothing with it, as defined here - https://github.com/FuelLabs/fuel-core/blob/df142c617730ca910ab0042a1f9615e1d7da4a7e/crates/services/producer/src/config.rs#L4-L7
--metrics
block_producer
txpool
p2p
and constructed here - https://github.com/FuelLabs/fuel-core/blob/2caca6145044bef4c92f6c64d8b5731545a4514a/crates/fuel-core/src/service/config.rs#L157-L159
We need to make a decision on a unified interface for the metrics logging, and ensure that each module that exports metrics makes use of the cli arg --metrics strictly.
related issue https://github.com/FuelLabs/fuel-core/issues/1361
related issue #1361
good catch, didn't go that far back :)
At the moment, all metrics definitions live in https://github.com/FuelLabs/fuel-core/tree/master/crates/metrics, and are used in modules differently.
For example, the
rocks_db
metrics, are updated as-is with no way for the operator to "opt-in" to this metric collection, shown in an example here - https://github.com/FuelLabs/fuel-core/blob/9f96573224056aa5a11233b821d34cb8ae4fad20/crates/fuel-core/src/state/rocks_db.rs#L551-L555furthermore, out of all the modules that use metrics, only 3 modules make use of the cli argument
--metrics
to disable/enable metrics collection, which areblock_producer
,txpool
, andp2p
. Please note thatblock_producer
has no metrics, but still takes in the metrics flag and does nothing with it, as defined here - https://github.com/FuelLabs/fuel-core/blob/df142c617730ca910ab0042a1f9615e1d7da4a7e/crates/services/producer/src/config.rs#L4-L7and constructed here - https://github.com/FuelLabs/fuel-core/blob/2caca6145044bef4c92f6c64d8b5731545a4514a/crates/fuel-core/src/service/config.rs#L157-L159
We need to make a decision on a unified interface for the metrics logging, and ensure that each module that exports metrics makes use of the cli arg
--metrics
strictly.