mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 02:09:04 +08:00
refactor(query-service): ♻️ move pprof to server.go
Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
parent
ac06b02d52
commit
9ba0b84a91
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
_ "net/http/pprof" // http profiler
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -257,7 +258,15 @@ func (s *Server) Start() error {
|
|||||||
zap.S().Error("Could not start HTTP server", zap.Error(err))
|
zap.S().Error("Could not start HTTP server", zap.Error(err))
|
||||||
}
|
}
|
||||||
s.unavailableChannel <- healthcheck.Unavailable
|
s.unavailableChannel <- healthcheck.Unavailable
|
||||||
|
}()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
zap.S().Info("Starting pprof server", zap.String("addr", constants.DebugHttpPort))
|
||||||
|
|
||||||
|
err = http.ListenAndServe(constants.DebugHttpPort, nil)
|
||||||
|
if err != nil {
|
||||||
|
zap.S().Error("Could not start HTTP server", zap.Error(err))
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -2,8 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
|
||||||
_ "net/http/pprof" // http profiler
|
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -35,10 +33,6 @@ func main() {
|
|||||||
logger := loggerMgr.Sugar()
|
logger := loggerMgr.Sugar()
|
||||||
version.PrintVersion()
|
version.PrintVersion()
|
||||||
|
|
||||||
go func() {
|
|
||||||
logger.Info(http.ListenAndServe(constants.DebugHttpPort, nil))
|
|
||||||
}()
|
|
||||||
|
|
||||||
serverOptions := &app.ServerOptions{
|
serverOptions := &app.ServerOptions{
|
||||||
// HTTPHostPort: v.GetString(app.HTTPHostPort),
|
// HTTPHostPort: v.GetString(app.HTTPHostPort),
|
||||||
// DruidClientUrl: v.GetString(app.DruidClientUrl),
|
// DruidClientUrl: v.GetString(app.DruidClientUrl),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user