mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16:44 +00:00
feat: bor_info metric
This commit is contained in:
parent
08f81df254
commit
7afea05a0d
2 changed files with 16 additions and 1 deletions
|
|
@ -4,8 +4,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/internal/cli"
|
"github.com/ethereum/go-ethereum/internal/cli"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
params.UpdateBorInfo()
|
||||||
os.Exit(cli.Run(os.Args[1:]))
|
os.Exit(cli.Run(os.Args[1:]))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ package params
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -27,7 +29,18 @@ const (
|
||||||
VersionMeta = "" // Version metadata to append to the version string
|
VersionMeta = "" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
var GitCommit string
|
var (
|
||||||
|
borInfo = metrics.NewRegisteredGaugeInfo("bor/info", nil)
|
||||||
|
GitCommit string
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateBorInfo updates the bor_info with the current git commit and version details.
|
||||||
|
func UpdateBorInfo() {
|
||||||
|
borInfo.Update(metrics.GaugeInfoValue{
|
||||||
|
"commit": GitCommit,
|
||||||
|
"version": VersionWithMeta,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
var Version = func() string {
|
var Version = func() string {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue