Skip to content

feat: add p2p metrics#94

Merged
varex83 merged 4 commits into
mainfrom
bohdan/p2p-metrics
Dec 18, 2025
Merged

feat: add p2p metrics#94
varex83 merged 4 commits into
mainfrom
bohdan/p2p-metrics

Conversation

@varex83

@varex83 varex83 commented Dec 9, 2025

Copy link
Copy Markdown
Collaborator

This PR implements P2P metrics, which are fully compatible with Go's implementation.

To verify that it's correct:

  1. Run local grafana & prometheus (by simply docker-compose up in /test-infra dir)
  2. Run the example in Rust cargo run --example metrics -p charon-p2p
  3. Create file (p2p/metrics_example_test.go) in Go's implementation with this contents
  4. And run go's example with go test -run TestMetricsServer -timeout 20s ./p2p

Then to verify: go to grafana and make sure all metrics exist with the same names and labels, the implementation names could be found in peer field (go and rust accordingly).

Closes #93

@varex83 varex83 requested a review from emlautarom1 December 9, 2025 15:36
@github-actions

github-actions Bot commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Coverage (base → head): 61.23% → 61.03% ⬇️ 0.2 pp
Only posts when PR coverage is lower than the base branch's latest push (or freshly computed base).

Comment thread crates/charon-p2p/examples/metrics.rs Outdated

@emlautarom1 emlautarom1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, I don't see anything particularly problematic.

@varex83 varex83 merged commit 679e7ea into main Dec 18, 2025
7 checks passed
@varex83 varex83 deleted the bohdan/p2p-metrics branch December 18, 2025 19:03
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 p2p/metrics

2 participants