feat: add metrics: balance per currency, number of unspent outputs, number of addresses #1666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #1148
Overview
Add metrics for childchain's balances, number of unspent outputs and addresses with unspent outputs.
Changes
total_unspent_outputs
: The total number of unspent outputs being tracked in the childchain servicetotal_unspent_addresses
: The total number of addresses holding at least 1 unspent outputbalance
: Same definition. Fixed where the balance was calculating only from the recent cacheunique_users
: Replaced bytotal_unspent_addresses
Note that I originally wanted to avoid or optimize utxos calling but it requires lower level opimization and the current DB can handle the load for the foreseeable future (see #1667 for some benchmark).
With this PR we get the utxos db observability and can monitor when the metrics become concerning so I think it's worth the extra call.
Testing
Follow these steps:
DD_DISABLED: false
andDD_API_KEY
at least on the childchainmake docker-build
cd priv/cabbage && make start_daemon_services-2