File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 66
77 "github.com/gobitfly/beaconchain/pkg/commons/db"
88 "github.com/gobitfly/beaconchain/pkg/commons/log"
9+ "github.com/gobitfly/beaconchain/pkg/commons/metrics"
910 "github.com/gobitfly/beaconchain/pkg/commons/types"
1011 "github.com/gobitfly/beaconchain/pkg/commons/utils"
1112 "github.com/gobitfly/beaconchain/pkg/commons/version"
@@ -31,6 +32,15 @@ func Run() {
3132 }
3233 utils .Config = cfg
3334
35+ if utils .Config .Metrics .Enabled {
36+ go func () {
37+ log .Infof ("serving metrics on %v" , utils .Config .Metrics .Address )
38+ if err := metrics .Serve (utils .Config .Metrics .Address , utils .Config .Metrics .Pprof , utils .Config .Metrics .PprofExtra ); err != nil {
39+ log .Fatal (err , "error serving metrics" , 0 )
40+ }
41+ }()
42+ }
43+
3444 db .ClickHouseWriter , db .ClickHouseReader = db .MustInitDB (& types.DatabaseConfig {
3545 Username : cfg .ClickHouse .WriterDatabase .Username ,
3646 Password : cfg .ClickHouse .WriterDatabase .Password ,
You can’t perform that action at this time.
0 commit comments