Skip to content
New issue

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

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

Already on GitHub? # to your account

Signer prometheus metrics #61

Merged
merged 17 commits into from
Nov 22, 2024
Merged

Signer prometheus metrics #61

merged 17 commits into from
Nov 22, 2024

Conversation

zone117x
Copy link
Member

@zone117x zone117x commented Nov 22, 2024

Closes #51

Adds public prometheus metrics endpoint /signer-metrics/metrics.

  • Signer acceptance states for last N blocks
  • Block acceptance rate for last N blocks
  • Average block push time for last N blocks
  • Time since last pending block proposal

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 99.11243% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/init.ts 40.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zone117x zone117x marked this pull request as ready for review November 22, 2024 11:46
Copy link

github-actions bot commented Nov 22, 2024

Vercel deployment URL: https://signer-metrics-c3o641n2q-hirosystems.vercel.app 🚀

Comment on lines +3 to +5
// First load default.env to prevent envSchema from throwing errors
const defaultParsed = dotenv.config({ path: `${__dirname}/default.env` }).parsed;
dotenv.populate(process.env as Record<string, string>, defaultParsed as Record<string, string>);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is indicative of a problem with our ENV init approach. Our modules have side-effects -- in this case src/env.ts has top-level evaluations to init the ENV object.

These lines setup some env var defaults to prevent that module from throwing errors. A better approach would be to remove side-effects from modules, for example make ENV a getter that only evals on demand.

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

Awesome

@zone117x zone117x merged commit d7a84f4 into main Nov 22, 2024
5 checks passed
@zone117x zone117x deleted the feat/signer-prom-metrics branch November 22, 2024 18:26
blockstack-devops pushed a commit that referenced this pull request Nov 22, 2024
## [0.12.0](v0.11.0...v0.12.0) (2024-11-22)

### Features

* signer prometheus metrics ([#61](#61)) ([d7a84f4](d7a84f4))
@blockstack-devops
Copy link

🎉 This PR is included in version 0.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add signer prometheus metrics
3 participants