Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pebble metrics registration [NIT-2468] #314

Merged
merged 2 commits into from
May 2, 2024

Conversation

magicxyyz
Copy link
Contributor

Pebble gauge metrics are stuck when twice opening same database (same metrics namespace). That happens in openInitializeChainDb: https://github.com/OffchainLabs/nitro/blob/e6afd28add5c9ff8be5952e3fe546d70015841af/cmd/nitro/init.go#L175-L181

Gauge metrics are created with metrics.NewRegisteredGauge and it fails silently if metric name already exists. The Meter metrics work despite that metrics.NewRegisteredMeter is used, because it calls metrics.GetOrRegisterMeter internally.

This PR fixes the issue by using metrics.GetOrRegister* functions instead.

@cla-bot cla-bot bot added the s CLA signed label May 2, 2024
@magicxyyz magicxyyz changed the title fix pebble metrics registration (NIT-2468) fix pebble metrics registration [NIT-2468] May 2, 2024
Copy link
Member

@Tristan-Wilson Tristan-Wilson left a comment

Choose a reason for hiding this comment

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

LGTM

@magicxyyz magicxyyz merged commit f941743 into master May 2, 2024
3 of 4 checks passed
@magicxyyz magicxyyz deleted the fix-pebble-metrics-registration branch May 2, 2024 15:55
@magicxyyz
Copy link
Contributor Author

just added a PR to upstream the fix: ethereum/go-ethereum#29699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants