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

Feat: added mining-related prometheus stats #2664

Merged
merged 4 commits into from
May 25, 2021
Merged

Conversation

pavitthrap
Copy link
Contributor

Description

Fixes #2651

Added the following metrics in prometheus:

  • Miner's computed relative miner score as a percentage (Gauge)
  • Miner's computed commitment, the min of their previous commitment and their median commitment
  • Miner's current median commitment

The latter two metrics are u128 values. Prometheus's IntGauge only captures 64 bit values, so I used two IntGauges for both of the metrics (one for the high 64 bits, and another for the low 64 bits).

Type of Change

  • New feature
  • Bug fix
  • API reference/documentation update
  • Other

Testing information

Ran BITCOIND_TEST=1 cargo test --release --features monitoring_prom -- --test-threads 1 --ignored neon_integrations::bitcoind_integration_test in the testnet/stacks-node directory. Pinged the prometheus endpoint and got the value of all tracked metrics, which I then checked against expected value.

Note: When running an integration test with a specific feature enabled, running the command above in the root directory of the repo doesn't work. If anyone understands why this is, let me know!

Ran cargo test.

src/monitoring/mod.rs Outdated Show resolved Hide resolved
…ange in consensus crit code, use lazy_static instead of unsafe block
src/monitoring/mod.rs Outdated Show resolved Hide resolved
…iner metric code into prometheus feature blocks
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM!

@pavitthrap pavitthrap merged commit 12b210a into develop May 25, 2021
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants