Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

client/beefy: add more metrics for production visibility#12910

Merged
paritytech-processbot[bot] merged 16 commits into
paritytech:masterfrom
dharjeezy:dharjeezy/beefy-metrics
Feb 16, 2023
Merged

client/beefy: add more metrics for production visibility#12910
paritytech-processbot[bot] merged 16 commits into
paritytech:masterfrom
dharjeezy:dharjeezy/beefy-metrics

Conversation

@dharjeezy
Copy link
Copy Markdown
Contributor

@dharjeezy dharjeezy commented Dec 12, 2022

More metrics for Beefy.

Closes #12893

Polkadot companion: paritytech/polkadot#6706

@dharjeezy
Copy link
Copy Markdown
Contributor Author

dharjeezy commented Jan 24, 2023

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/beefy-metrics

� Conflicts:
�	client/beefy/src/communication/request_response/incoming_requests_handler.rs
�	client/beefy/src/communication/request_response/outgoing_requests_engine.rs
�	client/beefy/src/import.rs
�	client/beefy/src/worker.rs
@dharjeezy dharjeezy marked this pull request as ready for review January 26, 2023 11:38
@dharjeezy dharjeezy requested a review from acatangiu as a code owner January 26, 2023 11:38
@dharjeezy
Copy link
Copy Markdown
Contributor Author

@acatangiu this is ready for review

@acatangiu acatangiu added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Jan 26, 2023
Copy link
Copy Markdown
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I've added some changes and additions suggestions below.

Comment thread client/beefy/src/communication/request_response/incoming_requests_handler.rs Outdated
Comment thread client/beefy/src/communication/request_response/incoming_requests_handler.rs Outdated
Comment thread client/beefy/src/import.rs Outdated
Comment thread client/beefy/src/import.rs Outdated
Comment thread client/beefy/src/lib.rs Outdated
Comment thread client/beefy/src/metrics.rs Outdated
Comment thread client/beefy/src/worker.rs
Comment thread client/beefy/src/metrics.rs Outdated
Comment thread client/beefy/src/worker.rs
Comment thread client/beefy/src/worker.rs
@acatangiu acatangiu requested a review from serban300 February 13, 2023 16:44
Copy link
Copy Markdown
Contributor

@serban300 serban300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ! Just 2 nits so far, but I'll do another pass on the PR later. Just want to look more carefully on the places where the metrics are updated.

Comment thread client/beefy/src/communication/request_response/incoming_requests_handler.rs Outdated
Comment thread client/beefy/src/worker.rs
Comment thread client/beefy/src/worker.rs
Copy link
Copy Markdown
Contributor

@Lederstrumpf Lederstrumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread client/beefy/src/metrics.rs
Comment thread client/beefy/src/metrics.rs Outdated
Comment thread client/beefy/src/worker.rs Outdated
@acatangiu
Copy link
Copy Markdown
Contributor

bot merge

@paritytech-processbot paritytech-processbot Bot merged commit 46c1bd5 into paritytech:master Feb 16, 2023
rossbulat pushed a commit that referenced this pull request Feb 19, 2023
* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
rossbulat pushed a commit that referenced this pull request Feb 19, 2023
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
…12910)

* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…12910)

* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Ank4n pushed a commit that referenced this pull request Feb 28, 2023
* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
…12910)

* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
…12910)

* few beefy metrics

* more beefy metrics

* some beefy metrics

* some beefy metrics

* more metrics

* other metrics

* fix tests

* merge changes

* Apply suggestions from code review

* client/beefy: fix metrics

* client/beefy: separate metrics per component, avoid double registering

* client/beefy: deduplicate metrics registration code

* remove unused metric

* impl review suggestions

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client/beefy: add more metrics for production visibility

4 participants