Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Apr 17, 2023
1 parent 3e4d959 commit f86eac3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cmd/soroban-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"
"net/http"
_ "net/http/pprof"
"net/http/pprof" //nolint:gosec
"os"
"os/signal"
"sync"
Expand Down Expand Up @@ -242,8 +242,11 @@ func MustNew(cfg config.LocalConfig, endpoint string, adminEndpoint string) *Dae
}
if adminEndpoint != "" {
adminMux := supporthttp.NewMux(logger)
// after importing net/http/pprof, debug endpoints are implicitly registered in the default serve mux
adminMux.Handle("/", http.DefaultServeMux)
adminMux.HandleFunc("/debug/pprof/", pprof.Index)
adminMux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
adminMux.HandleFunc("/debug/pprof/profile", pprof.Profile)
adminMux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
adminMux.HandleFunc("/debug/pprof/trace", pprof.Trace)
adminMux.Handle("/metrics", promhttp.HandlerFor(d.prometheusRegistry, promhttp.HandlerOpts{}))
d.adminServer = &http.Server{Addr: adminEndpoint, Handler: adminMux}
}
Expand Down
1 change: 0 additions & 1 deletion cmd/soroban-rpc/internal/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func (r *rpcLogger) LogRequest(ctx context.Context, req *jrpc2.Request) {
// Params are useful but can be really verbose, let's only print them in debug
logger = logger.WithField("params", req.ParamString())
logger.Debug("starting JSONRPC request params")

}

func (r *rpcLogger) LogResponse(ctx context.Context, rsp *jrpc2.Response) {
Expand Down

0 comments on commit f86eac3

Please sign in to comment.