Add prometheus to client and begin implementing custom metrics
This PR begins the Prometheus integration work by first adding a Prometheus client server to the ethereumjs client and then adding custom metrics discussed in #3089.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.93%. Comparing base (
4be68d2) to head (961afba). Report is 9 commits behind head on master.
:exclamation: Current head 961afba differs from pull request most recent head 39d1daa. Consider uploading reports for the commit 39d1daa to get more accurate results
Additional details and impacted files
| Flag | Coverage Δ | |
|---|---|---|
| block | 88.34% <ø> (+6.10%) |
:arrow_up: |
| blockchain | 91.61% <ø> (+0.68%) |
:arrow_up: |
| client | ? |
|
| common | 98.25% <ø> (+4.23%) |
:arrow_up: |
| devp2p | 82.12% <ø> (+0.75%) |
:arrow_up: |
| ethash | ∅ <ø> (?) |
|
| evm | 74.33% <ø> (+1.03%) |
:arrow_up: |
| genesis | 99.98% <ø> (ø) |
|
| statemanager | 77.02% <ø> (+2.30%) |
:arrow_up: |
| trie | 89.29% <ø> (+29.69%) |
:arrow_up: |
| tx | 95.45% <ø> (+9.74%) |
:arrow_up: |
| util | 89.13% <ø> (+7.81%) |
:arrow_up: |
| vm | 80.20% <ø> (+18.64%) |
:arrow_up: |
| wallet | 88.35% <ø> (+1.10%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Changes I have made to the original PR
- Add a new CLI flag for
prometheusPort - Moved
prometheusMetricsto a new optional property on theconfigobject that is passed around within the client. This should make for less repetitive code when we add new metrics in other places within theclient - Add better typing to
stopClientparameters inbin/cli.ts - Add minimal docs for how to start metrics server