substrate icon indicating copy to clipboard operation
substrate copied to clipboard

client/beefy: add more metrics for production visibility

Open dharjeezy opened this issue 3 years ago • 3 comments

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?

dharjeezy avatar Jan 24 '23 23:01 dharjeezy

@acatangiu this is ready for review

dharjeezy avatar Jan 26 '23 11:01 dharjeezy

bot merge

acatangiu avatar Feb 16 '23 12:02 acatangiu