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

Feature: add prometheus metrics #205

Merged
merged 9 commits into from
Oct 11, 2022

Conversation

0xcb9ff9
Copy link

@0xcb9ff9 0xcb9ff9 commented Sep 30, 2022

Description

Add metrics

blockchain:

  • dogechain_blockchain_gas_avg_price Gas price average (Histogram type)
  • dogechain_blockchain_gas_avg_count Gas count average (Histogram type)
  • dogechain_blockchain_gas_used Gas used number (Histogram type)
  • dogechain_blockchain_block_height block height (Gauge type)
  • dogechain_blockchain_block_write_seconds block write to db time (Histogram type)

JSON-RPC:

  • dogechain_jsonrpc_requests requests number (Counter type)
  • dogechain_jsonrpc_request_errors error request number (Counter type)
  • dogechain_jsonrpc_response_seconds request handle time (Histogram type)

Changes include

  • 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)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@0xcb9ff9 0xcb9ff9 added the feature New update to Dogechain label Sep 30, 2022
@0xcb9ff9 0xcb9ff9 self-assigned this Sep 30, 2022
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

A cool feature. 🙌
DAPP developer and node maintainer would found it very useful.

blockchain/blockchain.go Outdated Show resolved Hide resolved
blockchain/blockchain.go Outdated Show resolved Hide resolved
blockchain/metrics.go Outdated Show resolved Hide resolved
jsonrpc/metrics.go Outdated Show resolved Hide resolved
blockchain/metrics.go Show resolved Hide resolved
jsonrpc/metrics.go Show resolved Hide resolved
blockchain/metrics.go Show resolved Hide resolved
Copy link
Collaborator

@abrahamcruise321 abrahamcruise321 left a comment

Choose a reason for hiding this comment

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

ok

@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2022

Codecov Report

Merging #205 (3e791eb) into dev (f4bd245) will decrease coverage by 0.21%.
The diff coverage is 22.13%.

@@            Coverage Diff             @@
##              dev     #205      +/-   ##
==========================================
- Coverage   51.31%   51.10%   -0.22%     
==========================================
  Files         115      117       +2     
  Lines       17345    17475     +130     
==========================================
+ Hits         8901     8931      +30     
- Misses       7685     7784      +99     
- Partials      759      760       +1     
Impacted Files Coverage Δ
jsonrpc/jsonrpc.go 18.87% <7.14%> (-0.80%) ⬇️
jsonrpc/metrics.go 17.77% <17.77%> (ø)
blockchain/metrics.go 23.52% <23.52%> (ø)
blockchain/blockchain.go 49.70% <31.57%> (-0.42%) ⬇️
blockchain/testing.go 60.28% <100.00%> (+0.38%) ⬆️
protocol/sync_peer.go 70.00% <0.00%> (+1.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

DarianShawn
DarianShawn previously approved these changes Oct 10, 2022
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Great job.
Thank you for your important contribution to this. 🙏

@DarianShawn DarianShawn merged commit 3b344b7 into dogechain-lab:dev Oct 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2022
@0xcb9ff9 0xcb9ff9 deleted the feature/add_metric branch October 11, 2022 09:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Dogechain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants