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

metrics/prometheus: fix count field of metric #965

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

manav2401
Copy link
Contributor

Description

With changes done in #881 and #893, the count field of a metric was added into summary and was calculated in wrong way. The tests didn't complain as they were updated in few places to cater to the new logic or the values according to the new logic vs old logic turned out to be same for the test case

E.g. histogram count should be ideally 0 as no values are reported but it was changed to 6 which actually denotes the total percentile values reported. In case of timers, the values reported were 6 and the percentiles were also 6 so the test didn't catch this check.

This PR updates (or actually reverts) the reporting of count metric. Instead of reporting count as len(values) where values are the total percentiles reported, we fetch it directly from metric.Count() function as earlier (and also similar to how geth does).

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@manav2401 manav2401 requested review from rekibnikufesin and a team August 16, 2023 10:07
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

❗ No coverage uploaded for pull request base (v0.5.0-beta-candidate-2@a602479). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             v0.5.0-beta-candidate-2     #965   +/-   ##
==========================================================
  Coverage                           ?   57.11%           
==========================================================
  Files                              ?      633           
  Lines                              ?    77332           
  Branches                           ?        0           
==========================================================
  Hits                               ?    44168           
  Misses                             ?    29404           
  Partials                           ?     3760           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@rekibnikufesin rekibnikufesin left a comment

Choose a reason for hiding this comment

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

:shipit:

@manav2401 manav2401 merged commit a5b1ae5 into v0.5.0-beta-candidate-2 Aug 16, 2023
8 checks passed
@manav2401 manav2401 deleted the manav/fix-count-in-metrics branch August 16, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants