Skip to content

Commit

Permalink
add vocdoni_info metric with version, mode and chainID
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Nov 6, 2023
1 parent 3fdb271 commit 507cac0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"syscall"
"time"

"github.com/VictoriaMetrics/metrics"
"github.com/google/uuid"
flag "github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -515,6 +516,9 @@ func main() {
// This flag will make CometBFT register their metrics in prometheus
srv.Config.TendermintMetrics = true
srv.Router.ExposePrometheusEndpoint("/metrics")

metrics.NewCounter(fmt.Sprintf("vocdoni_info{version=%q,mode=%q,chain=%q}",
internal.Version, conf.Mode, conf.Vochain.Chain)).Set(1)
}
}

Expand Down
3 changes: 3 additions & 0 deletions cmd/voconed/voconed.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"syscall"
"time"

"github.com/VictoriaMetrics/metrics"
"github.com/ethereum/go-ethereum/common"
flag "github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -232,6 +233,8 @@ func main() {
}

vc.Router.ExposePrometheusEndpoint("/metrics")
metrics.NewCounter(fmt.Sprintf("vocdoni_info{version=%q,mode=%q,chain=%q}",
internal.Version, "vocone", config.chainID)).Set(1)

// enable faucet if requested, this will create a new account and attach the faucet API to the vocone API
if config.enableFaucetWithAmount > 0 {
Expand Down

0 comments on commit 507cac0

Please sign in to comment.