ChainSafe / ChainSafe/lodestar

Metrics to add tracker

Open
#2,468 5 comments 0 reactions 0 assignees View on GitHub
epic scope-metrics
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 16h
Merged PRs (30d)
150

Description

## Ready to execute

- https://github.com/ChainSafe/lodestar/issues/2483
- https://github.com/ChainSafe/lodestar/issues/2984
- https://github.com/ChainSafe/lodestar/issues/3033
- https://github.com/ChainSafe/lodestar/issues/3112
- https://github.com/ChainSafe/lodestar/issues/3115
- https://github.com/ChainSafe/lodestar/issues/3205
- https://github.com/ChainSafe/lodestar/issues/3413
- https://github.com/ChainSafe/lodestar/issues/3680
- https://github.com/ChainSafe/lodestar/issues/3946
- https://github.com/ChainSafe/lodestar/pull/4122 ReqResp request times
- https://github.com/ChainSafe/lodestar/pull/4123 Reorg depth histogram
- https://github.com/ChainSafe/lodestar/pull/4123 Distance to parent block histogram
- https://github.com/ChainSafe/lodestar/pull/4124 Histogram of balance increase for block proposer
- https://github.com/ChainSafe/lodestar/pull/4125 Total signatures aggregated (optional histogram for time spent aggregating)
- https://github.com/ChainSafe/lodestar/pull/4127 JSON RPC client metrics
- From Lighthouse: https://github.com/ChainSafe/lodestar/issues/4273
- From Lighthouse: https://github.com/ChainSafe/lodestar/issues/4274
- From Lighthouse: https://github.com/ChainSafe/lodestar/issues/2558
- From Lighthouse: https://github.com/ChainSafe/lodestar/issues/2984
- From Lighthouse: https://github.com/ChainSafe/lodestar/issues/2473

## Metric ideas

### Misc

Once properly defined, convert to issue or pull request and move above to "**Ready to execute**"

- Improve state.clone() metrics, what we really care about is before doing state-transitions if the state has cache or not.
- Add more sync metrics to measure efficiency: # blocks downloaded to process # of blocks. To count duplicated downloads indirectly.
- Discv5 ping times
- Gossipsub received blocks
- Blocks in last epoch, to compute percent of orphaned
- More HTTP metrics?

### From Lighthouse

Reviewed this file and select interesting metrics to add
https://github.com/sigp/lighthouse/blob/stable/beacon_node/beacon_chain/src/metrics.rs

**Block Delay Metrics**

- [x] `beacon_block_imported_slot_start_delay_time`: Duration between the start of the blocks slot and the current time when it was imported.
- [x] `beacon_block_head_slot_start_delay_time`: Duration between the start of the blocks slot and the current time when it was as head.
- [ ] `beacon_block_head_slot_start_delay_exceeded_total`: Triggered when the duration between the start of the blocks slot and the current time will result in failed attestations. https://github.com/ChainSafe/lodestar/pull/5559

**Persisting BeaconChain components to disk**

- [ ] `beacon_persist_head`: Time taken to persist the canonical head
- [ ] `beacon_persist_op_pool`: Time taken to persist the operations pool - Does Lighthouse keep all ops in memory?
- [ ] `beacon_persist_eth1_cache`: Time taken to persist the eth1 caches

**Chain Head**

- [x] `beacon_update_head_seconds`: Time taken to update the canonical head - Review what does it refer too

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked Lodestar issues and pull requests, then compare the metric ideas with Lighthouse's beacon_node/beacon_chain/src/metrics.rs. The tracker is done when a metric is properly defined, converted into a concrete issue or pull request, and moved to the Ready to execute section.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.