avalanchego
avalanchego copied to clipboard
ETA metrics are kept to 0
Describe the bug Prometheus ETA metrics are always 0. They seem to be correctly set at https://github.com/ava-labs/avalanchego/blob/master/snow/engine/common/queue/jobs.go#L188 but are then immediatly set back to 0 at https://github.com/ava-labs/avalanchego/blob/master/snow/engine/common/queue/jobs.go#L204
To Reproduce
Run a curl -X POST 127.0.0.1:9650/ext/metrics | less
on a bootstrapping node and check the following metrics:
avalanche_C_block_eta_execution_complete
avalanche_C_bs_eta_fetching_complete
avalanche_X_tx_eta_execution_complete
avalanche_X_vtx_eta_execution_complete
avalanche_P_block_eta_execution_complete
avalanche_P_bs_eta_fetching_complete
Expected behavior Correctly display the "ETA in nanoseconds until execution phase of bootstrapping finishes"
Operating System Debian Bullseye
I'm unfamiliar with the code base, but it looks like https://github.com/ava-labs/avalanchego/blob/master/snow/engine/common/queue/jobs.go#L204 should just be moved to https://github.com/ava-labs/avalanchego/blob/master/snow/engine/common/queue/jobs.go#L115 for it to work as intended
Ah - eagle eye. It was intended for this metric to be zeroed out outside of the for
's scope. Will be fixed in the next release.
Closing this down since it is fixed