Skip to content

Initial metrics implementation#72

Merged
ArtiomTr merged 1 commit intograndinetech:mainfrom
ArtiomTr:feature/metrics
Feb 3, 2026
Merged

Initial metrics implementation#72
ArtiomTr merged 1 commit intograndinetech:mainfrom
ArtiomTr:feature/metrics

Conversation

@ArtiomTr
Copy link
Collaborator

@ArtiomTr ArtiomTr commented Feb 3, 2026

Implemented metrics by specification. Currently few metrics are still missing:

  • lean_current_slot - needs chain service to be passed into http api, but it is not currently thread-safe, so a bit of refactoring is needed;
  • lean_fork_choice_reorgs_total and lean_fork_choice_reorg_depth - requires detecting & computing forkchoice reorgs, so will be added later;
  • lean_finalizations_total - also requires additional code to track.

lean_connected_peers a bit variates from specification, because peer labels are currently not tracked. All peers are currently marked with "unknown" label.

Closes #39.

Implemented metrics by [specification]. Currently few metrics are still
missing:
* `lean_current_slot` - needs chain service to be passed into http api,
  but it is not currently thread-safe, so a bit of refactoring is
  needed;
* `lean_fork_choice_reorgs_total` and `lean_fork_choice_reorg_depth` -
  requires detecting & computing forkchoice reorgs, so will be added
  later;
* `lean_finalizations_total` - also requires additional code to track.

`lean_connected_peers` a bit variates from specification, because peer
labels are currently not tracked. All peers are currently marked with
"unknown" label.

[specification]: https://github.com/leanEthereum/leanMetrics.
@ArtiomTr ArtiomTr merged commit 483e3b8 into grandinetech:main Feb 3, 2026
0 of 3 checks passed
@ArtiomTr ArtiomTr deleted the feature/metrics branch February 3, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement metrics

1 participant