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 #1422

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Jan 13, 2025

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:

  1. All files in metrics are deleted EXCEPT:
    • metrics/prometheus/prometheus.go
    • metrics/prometheus/prometheus_test.go
    • metrics/prometheus/interfaces.go (new file added whilst refactoring)
    • go-ethereum's metrics.Enabled is set to true in initializeMetrics
  2. Refactoring and fixes were done in some intermediary step (in chore(metrics/prometheus): add files needed for coreth and subnet-evm libevm#103), so I decided to bring this over here so it doesn't get trashed. I can split it in another PR if you feel it's necessary.

How this was tested

CI passing

Need to be documented?

No

Need to update RELEASES.md?

Not really, since it should not change anything 🙏

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
Comment on lines 190 to 191
default:
return nil, fmt.Errorf("metric type is not supported: %T", metric)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took the liberty to change this to return an error (instead of silently ignoring it) on an unsupported type to prevent in the future to define new types and forget to add the implementation in the switch here.

metrics/prometheus/prometheus.go Show resolved Hide resolved
@qdm12 qdm12 marked this pull request as ready for review January 13, 2025 16:08
@qdm12 qdm12 requested review from ceyonur, darioush and a team as code owners January 13, 2025 16:08
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
warp/handlers/signature_request_test.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch from 7c08815 to 15866c8 Compare January 15, 2025 11:15
@qdm12 qdm12 requested a review from darioush January 15, 2025 11:40
@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 force-pushed the qdm12/libevm/metrics branch from 15866c8 to 769d5fc Compare January 27, 2025 12:50
@qdm12 qdm12 force-pushed the qdm12/libevm/metrics branch from 769d5fc to b008bf7 Compare January 27, 2025 13:33
Copy link

@maru-ava maru-ava left a comment

Choose a reason for hiding this comment

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

Looks good! The subnet dashboard is now populated with metrics for the load test e2e job:

A random PR doesn't show any metrics on the subnets dashboard for the same job:

@qdm12
Copy link
Collaborator Author

qdm12 commented Jan 28, 2025

A random PR doesn't show any metrics on the subnets dashboard for the same job:

Ah, let me check if I can revert it to no-metric, and open another PR (based off this one I suppose) to enable metrics.
Since this PR is not meant to change anything and should be pure maintenance / code movement.

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.

3 participants