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

chore(metrics): use geth metrics package and delete local metrics #745

Merged
merged 26 commits into from
Feb 10, 2025

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Jan 13, 2025

ℹ️ pretty much copy pasta of ava-labs/subnet-evm#1422

Why this should be merged

Contribution to the libevm effort.
Note there are the same changes for both coreth and subnet-evm, but they should not be part of libevm since these are extra features specific to subnet-evm/coreth, even if they're the same for both.

How this works

Comparing the following:

Therefore:

  • file kept and refactored metrics/prometheus/prometheus.go with the Gatherer implementation we use
  • file kept and refactored metrics/prometheus/prometheus_test.go
  • new file metrics/prometheus/interfaces.go added for refactoring
  • geth global variable metrics.Enabled is set to true in plugin/evm.VM.initializeMetrics

Note for the two files refactored (with fixes as well), this was done in some intermediary step in ava-labs/libevm#103, so I decided to bring this over here so it doesn't get trashed.

How this was tested

CI passing

Need to be documented?

No

Need to update RELEASES.md?

Not really, since it should not change anything 🙏

@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch 3 times, most recently from f8dadc2 to dd1a167 Compare January 13, 2025 12:11
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch 2 times, most recently from 2164d72 to caf4d61 Compare January 13, 2025 15:23
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Show resolved Hide resolved
plugin/evm/vm.go Show resolved Hide resolved
warp/handlers/signature_request_test.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
@qdm12 qdm12 marked this pull request as ready for review January 13, 2025 16:25
@qdm12 qdm12 requested review from ceyonur, darioush and a team as code owners January 13, 2025 16:25
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch 3 times, most recently from d7b1c12 to 3e3d44c Compare January 14, 2025 12:16
@darioush
Copy link
Collaborator

some review suggestions: #747

darioush
darioush previously approved these changes Jan 14, 2025
Copy link
Collaborator Author

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Self review

plugin/evm/config/config.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
darioush
darioush previously approved these changes Jan 15, 2025
plugin/evm/vm_test.go Outdated Show resolved Hide resolved
scripts/geth-allowed-packages.txt Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch from 00f7ec7 to 97bdf9e Compare January 23, 2025 09:00
darioush
darioush previously approved these changes Jan 23, 2025
@darioush
Copy link
Collaborator

I think you may have to fix the regex on the linter.

@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch 3 times, most recently from 1354b31 to bbce8d0 Compare January 24, 2025 12:02
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch from bbce8d0 to 5e17fb5 Compare January 24, 2025 21:04
@qdm12 qdm12 changed the title chore(metrics): use libevm metrics package and delete local metrics chore(metrics): use geth metrics package and delete local metrics Jan 27, 2025
@qdm12 qdm12 enabled auto-merge (squash) January 28, 2025 10:56
@qdm12 qdm12 disabled auto-merge January 28, 2025 12:15
qdm12 added a commit to ava-labs/avalanchego that referenced this pull request Feb 7, 2025
@qdm12
Copy link
Collaborator Author

qdm12 commented Feb 10, 2025

This is working fine when plugged into avalanchego in ava-labs/avalanchego#3708

merging this 😉

@qdm12 qdm12 enabled auto-merge (squash) February 10, 2025 07:47
@qdm12 qdm12 merged commit 66c1a92 into master Feb 10, 2025
8 checks passed
@qdm12 qdm12 deleted the qdm12/libevm/metrics branch February 10, 2025 07:56
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.

4 participants