Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
erigon_info metric (erigontech#7769)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Jun 21, 2023
1 parent 3542298 commit 7bad6d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/erigon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"reflect"
"strings"

"github.com/VictoriaMetrics/metrics"
"github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/log/v3"
"github.com/pelletier/go-toml"
Expand Down Expand Up @@ -58,7 +59,10 @@ func runErigon(cliCtx *cli.Context) error {
}

// 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)
erigonInfoGauge := metrics.GetOrCreateCounter(fmt.Sprintf(`erigon_info{version="%s",commit="%s"}`, params.Version, params.GitCommit))
erigonInfoGauge.Set(1)

nodeCfg := node.NewNodConfigUrfave(cliCtx, logger)
ethCfg := node.NewEthConfigUrfave(cliCtx, nodeCfg, logger)
Expand Down

0 comments on commit 7bad6d3

Please sign in to comment.