Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor metrics #2312

Merged
merged 2 commits into from
Mar 31, 2021
Merged

Refactor metrics #2312

merged 2 commits into from
Mar 31, 2021

Conversation

dapplion
Copy link
Contributor

Motivation

  • Our metrics setup is unnecessary verbose, having to declare each metric 3 times in different places
  • prom-client native classes do not have sufficient features to allow the gossip validation queue metrics to be separated by labels instead of different metric names. Having a single gossip_validation_queue and then each topic use a different label simplifies a lot the charts in Grafana.

Description

  • Create all metrics in functions without return type, to prevent declaring metrics multiple times.
  • Create GaugeExtra and HistogramExtra which allow to:
    • Create child classes with pre-defined labels
    • Attach multiple collect() functions after instantiation.
  • Rename IBeaconMetrics to IMetrics
  • Remove un-used PushGateway code
  • Update metric name in Grafana dashboard

@github-actions github-actions bot added CLI scope-networking All issues related to networking, gossip, and libp2p. labels Mar 31, 2021
@codeclimate
Copy link

codeclimate bot commented Mar 31, 2021

Code Climate has analyzed commit 0c133c5 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 3

View more on Code Climate.

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

Sad to see the PushGateway code go, but we can always bring it back if/when we need.

Other than that, looks great.

@wemeetagain wemeetagain merged commit 55ff6fe into master Mar 31, 2021
@wemeetagain wemeetagain deleted the dapplion/refactor-metrics branch March 31, 2021 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-networking All issues related to networking, gossip, and libp2p.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants