File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ package cmd
22
33import (
44 "fmt"
5+ "net/http"
56
7+ "github.com/prometheus/client_golang/prometheus/promhttp"
8+ "github.com/rs/zerolog/log"
69 "github.com/spf13/cobra"
710 "github.com/thirdweb-dev/indexer/internal/committer"
811)
@@ -16,6 +19,16 @@ var committerCmd = &cobra.Command{
1619
1720func RunCommitter (cmd * cobra.Command , args []string ) {
1821 fmt .Println ("running committer" )
22+
23+ // Start Prometheus metrics server
24+ log .Info ().Msg ("Starting Metrics Server on port 2112" )
25+ go func () {
26+ http .Handle ("/metrics" , promhttp .Handler ())
27+ if err := http .ListenAndServe (":2112" , nil ); err != nil {
28+ log .Error ().Err (err ).Msg ("Metrics server error" )
29+ }
30+ }()
31+
1932 committer .Init ()
2033 committer .CommitStreaming ()
2134}
You can’t perform that action at this time.
0 commit comments