Add Prometheus initial setup

This commit is contained in:
arnaucube
2021-02-15 16:43:27 +01:00
parent 9d08ec6978
commit 971b2c1d40
8 changed files with 132 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/hermeznetwork/hermez-node/log"
"github.com/hermeznetwork/hermez-node/synchronizer"
"github.com/hermeznetwork/tracerr"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func handleNoRoute(c *gin.Context) {
@@ -107,6 +108,8 @@ func (a *DebugAPI) Run(ctx context.Context) error {
api.Use(cors.Default())
debugAPI := api.Group("/debug")
debugAPI.GET("/metrics", gin.WrapH(promhttp.Handler()))
debugAPI.GET("sdb/batchnum", a.handleCurrentBatch)
debugAPI.GET("sdb/mtroot", a.handleMTRoot)
// Accounts returned by these endpoints will always have BatchNum = 0,