substrate
substrate copied to clipboard
client/beefy: add more metrics for production visibility
More metrics for Beefy.
- [ ] voting - trying to vote with no session initialized
- [x] voting - no authority public key found in store
- [x] voting - buffered votes
- [x] voting - votes buffer full
- [x] voting - buffered justifications
- [x] voting - justifications buffer full
- [x] voting - trying to set best beefy to old block
- [x] voting - successfully handled votes
- [x] voting - successfully voted
- [x] import - bad justif import
- [x] import - good justif import
- [x] respond to justification request - success
- [x] respond to justification request - failure/error
- [x] on demand justification - no peers to request from
- [x] on demand justification - peer hang-up
- [x] on demand justification - peer error
- [x] on demand justification - invalid proof
- [x] on demand justification - good proof - success
closes #12893
Hello @acatangiu
I have an issue, when i try to implement metric for when no voting session is initialized
I try to include the metrics property in the struct VoterOracle which i will then use to set the metric.
But then, VoterOracle implements the Decode, Encode, and PartialEq which i can't actually impelement for the Metrics struct due to these error
--> client/beefy/src/metrics.rs:24:24
|
24 | #[derive(Clone, Debug, Encode, Decode, PartialEq)]
| ^^^^^^ the trait `WrapperTypeEncode` is not implemented for `GenericGauge<substrate_prometheus_endpoint::U64>`
|
= help: the following other types implement trait `WrapperTypeEncode`:
--> client/beefy/src/metrics.rs:50:2
|
50 | / /// Trying to set Best Beefy block to old block
51 | | pub beefy_best_block_to_old_block: Gauge<U64>,
| |_________________________________________________^ the trait `WrapperTypeDecode` is not implemented for `GenericGauge<substrate_prometheus_endpoint::U64>`
|
error[E0369]: binary operation `==` cannot be applied to type `GenericGauge<substrate_prometheus_endpoint::U64>`
--> client/beefy/src/metrics.rs:27:2
|
24 | #[derive(Clone, Debug, Encode, Decode, PartialEq)]
| --------- in this derive macro expansion
...
27 | pub beefy_validator_set_id: Gauge<U64>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
I am curious how to go about this?
@acatangiu this is ready for review
bot merge