mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 22:29:01 +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"
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // http profiler
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@ -257,7 +258,15 @@ func (s *Server) Start() error {
|
||||
zap.S().Error("Could not start HTTP server", zap.Error(err))
|
||||
}
|
||||
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
|
||||
|
@ -2,8 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
_ "net/http/pprof" // http profiler
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@ -35,10 +33,6 @@ func main() {
|
||||
logger := loggerMgr.Sugar()
|
||||
version.PrintVersion()
|
||||
|
||||
go func() {
|
||||
logger.Info(http.ListenAndServe(constants.DebugHttpPort, nil))
|
||||
}()
|
||||
|
||||
serverOptions := &app.ServerOptions{
|
||||
// HTTPHostPort: v.GetString(app.HTTPHostPort),
|
||||
// DruidClientUrl: v.GetString(app.DruidClientUrl),
|
||||
|
Loading…
x
Reference in New Issue
Block a user