erigon_info metric (#7769)

This commit is contained in:
Alex Sharov 2023-06-21 11:13:50 +07:00 committed by GitHub
parent 3542298664
commit 7bad6d3fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import (
"reflect" "reflect"
"strings" "strings"
"github.com/VictoriaMetrics/metrics"
"github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/log/v3"
"github.com/pelletier/go-toml" "github.com/pelletier/go-toml"
@ -58,7 +59,10 @@ func runErigon(cliCtx *cli.Context) error {
} }
// initializing the node and providing the current git commit there // initializing the node and providing the current git commit there
logger.Info("Build info", "git_branch", params.GitBranch, "git_tag", params.GitTag, "git_commit", params.GitCommit) logger.Info("Build info", "git_branch", params.GitBranch, "git_tag", params.GitTag, "git_commit", params.GitCommit)
erigonInfoGauge := metrics.GetOrCreateCounter(fmt.Sprintf(`erigon_info{version="%s",commit="%s"}`, params.Version, params.GitCommit))
erigonInfoGauge.Set(1)
nodeCfg := node.NewNodConfigUrfave(cliCtx, logger) nodeCfg := node.NewNodConfigUrfave(cliCtx, logger)
ethCfg := node.NewEthConfigUrfave(cliCtx, nodeCfg, logger) ethCfg := node.NewEthConfigUrfave(cliCtx, nodeCfg, logger)