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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2df7e5f
chore(metrics): use libevm metrics package and delete local metrics
qdm12 Jan 13, 2025
88ed1d4
Migrate subnet-evm specific files back to metrics/prometheus
qdm12 Jan 13, 2025
6eb0653
tests: only enable metrics and revert to disable if already disabled
qdm12 Jan 13, 2025
905aaa9
Enable metrics by default with init block
qdm12 Jan 13, 2025
e9201f5
Use latest tagged libevm release
qdm12 Jan 13, 2025
58241f7
Change copyright notice from 2025 to 2021-2025
qdm12 Jan 13, 2025
d8d0f84
Change copyright notice from 2025 to 2021-2025
qdm12 Jan 13, 2025
26c2664
Use go-ethereum instead of libevm
qdm12 Jan 13, 2025
c471a70
Only set `metrics.Enabled` in `VM.Initalize`
qdm12 Jan 13, 2025
5c9fac8
Better handling for metrics re-registration (#747)
darioush Jan 14, 2025
c3a3706
Remove now unneeded option metrics-enabled
qdm12 Jan 14, 2025
be0acbd
Add comments for exported members
qdm12 Jan 15, 2025
635783d
Revert unneeded change for sdkMetrics interface
qdm12 Jan 15, 2025
c131269
Add metric name to error wrapping
qdm12 Jan 15, 2025
7f47d8c
Very minor changes in metrics/prometheus
qdm12 Jan 15, 2025
fcf78fa
Add metrics/prometheus test cases for full test coverage
qdm12 Jan 15, 2025
cd91e1a
Removed TODO since geth doesn't set any sum
qdm12 Jan 15, 2025
70e37df
Forgotten comment revert
qdm12 Jan 15, 2025
b2d334a
plugin/evm/testutils `WithMetrics`
qdm12 Jan 15, 2025
491f5ff
`resetMetrics` helper test function
qdm12 Jan 23, 2025
97bdf9e
Remove strange line from geth-allowed-packages.txt
qdm12 Jan 23, 2025
5e17fb5
Exclude core/main_test.go from lint_allowed_geth_imports.sh
qdm12 Jan 24, 2025
addccf9
Merge branch 'master' into qdm12/libevm/metrics
qdm12 Jan 28, 2025
82af695
Merge branch 'master' into qdm12/libevm/metrics
qdm12 Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import (
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/internal/version"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/trie"
"github.com/ava-labs/coreth/triedb"
Expand All @@ -58,6 +57,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestMain(m *testing.M) {
opts := []goleak.Option{
// No good way to shut down these goroutines:
goleak.IgnoreTopFunction("github.com/ava-labs/coreth/core/state/snapshot.(*diskLayer).generate"),
goleak.IgnoreTopFunction("github.com/ava-labs/coreth/metrics.(*meterArbiter).tick"),
goleak.IgnoreTopFunction("github.com/ethereum/go-ethereum/metrics.(*meterArbiter).tick"),
goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain"),
}
goleak.VerifyTestMain(m, opts...)
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (
"encoding/binary"

"github.com/ava-labs/avalanchego/utils/wrappers"
"github.com/ava-labs/coreth/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/metrics"
)

// The fields below define the low level database schema prefixing.
Expand Down
2 changes: 1 addition & 1 deletion core/state/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

package state

import "github.com/ava-labs/coreth/metrics"
import "github.com/ethereum/go-ethereum/metrics"

var (
accountUpdatedMeter = metrics.NewRegisteredMeter("state/update/account", nil)
Expand Down
2 changes: 1 addition & 1 deletion core/state/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (

"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/triedb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
"time"

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/trie/trienode"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/uint256"
)
Expand Down
2 changes: 1 addition & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/state/snapshot"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/predicate"
"github.com/ava-labs/coreth/trie"
Expand All @@ -47,6 +46,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/holiman/uint256"
)

Expand Down
2 changes: 1 addition & 1 deletion core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"sync"

"github.com/ava-labs/coreth/libevm/options"
"github.com/ava-labs/coreth/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/state/trie_prefetcher_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/state/snapshot"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/triedb"
"github.com/ava-labs/coreth/triedb/hashdb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/metrics"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/blobpool/blobpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ import (
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/txpool"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
"github.com/holiman/billy"
"github.com/holiman/uint256"
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/blobpool/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

package blobpool

import "github.com/ava-labs/coreth/metrics"
import "github.com/ethereum/go-ethereum/metrics"

var (
// datacapGauge tracks the user's configured capacity for the blob pool. It
Expand Down
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ import (
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/txpool"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/prque"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/holiman/uint256"
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (

"github.com/ava-labs/coreth/core"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ require (
github.com/olekukonko/tablewriter v0.0.5
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_model v0.3.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/spf13/cast v1.5.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.12.0
Expand All @@ -41,7 +40,6 @@ require (
golang.org/x/crypto v0.31.0
golang.org/x/exp v0.0.0-20231127185646-65229373498e
golang.org/x/sync v0.10.0
golang.org/x/sys v0.28.0
golang.org/x/text v0.21.0
golang.org/x/time v0.3.0
golang.org/x/tools v0.22.0
Expand Down Expand Up @@ -101,6 +99,7 @@ require (
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
Expand All @@ -122,6 +121,7 @@ require (
go.uber.org/zap v1.26.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect
Expand Down
1 change: 0 additions & 1 deletion metrics/FORK.md

This file was deleted.

29 changes: 0 additions & 29 deletions metrics/LICENSE

This file was deleted.

102 changes: 0 additions & 102 deletions metrics/README.md

This file was deleted.

43 changes: 0 additions & 43 deletions metrics/config.go

This file was deleted.

Loading
Loading