diff --git a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml index d0a22e95e6..6024201cb8 100644 --- a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml @@ -39,8 +39,9 @@ services: query-service: image: signoz/query-service:0.8.0 command: ["-config=/root/config/prometheus.yml"] - ports: - - "8080:8080" + # ports: + # - "6060:6060" # pprof port + # - "8080:8080" # query-service port volumes: - ./prometheus.yml:/root/config/prometheus.yml - ../dashboards:/root/config/dashboards @@ -85,7 +86,7 @@ services: - "4317:4317" # OTLP gRPC receiver - "4318:4318" # OTLP HTTP receiver # - "8889:8889" # Prometheus metrics exposed by the agent - # - "13133" # health_check + # - "13133:13133" # health_check # - "14268:14268" # Jaeger receiver # - "55678:55678" # OpenCensus receiver # - "55679:55679" # zpages extension diff --git a/deploy/docker/clickhouse-setup/docker-compose.arm.yaml b/deploy/docker/clickhouse-setup/docker-compose.arm.yaml index bb5dbb5207..cc29115bf1 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.arm.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.arm.yaml @@ -40,6 +40,9 @@ services: image: signoz/query-service:0.8.0 container_name: query-service command: ["-config=/root/config/prometheus.yml"] + # ports: + # - "6060:6060" # pprof port + # - "8080:8080" # query-service port volumes: - ./prometheus.yml:/root/config/prometheus.yml - ../dashboards:/root/config/dashboards @@ -82,7 +85,7 @@ services: - "4317:4317" # OTLP gRPC receiver - "4318:4318" # OTLP HTTP receiver # - "8889:8889" # Prometheus metrics exposed by the agent - # - "13133" # health_check + # - "13133:13133" # health_check # - "14268:14268" # Jaeger receiver # - "55678:55678" # OpenCensus receiver # - "55679:55679" # zpages extension diff --git a/deploy/docker/clickhouse-setup/docker-compose.yaml b/deploy/docker/clickhouse-setup/docker-compose.yaml index 7f484c913d..e18d584e1d 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.yaml @@ -39,6 +39,9 @@ services: image: signoz/query-service:0.8.0 container_name: query-service command: ["-config=/root/config/prometheus.yml"] + # ports: + # - "6060:6060" # pprof port + # - "8080:8080" # query-service port volumes: - ./prometheus.yml:/root/config/prometheus.yml - ../dashboards:/root/config/dashboards @@ -80,7 +83,7 @@ services: - "4317:4317" # OTLP gRPC receiver - "4318:4318" # OTLP HTTP receiver # - "8889:8889" # Prometheus metrics exposed by the agent - # - "13133" # health_check + # - "13133:13133" # health_check # - "14268:14268" # Jaeger receiver # - "55678:55678" # OpenCensus receiver # - "55679:55679" # zpages extension diff --git a/pkg/query-service/app/server.go b/pkg/query-service/app/server.go index 7908e79c18..054c8113c7 100644 --- a/pkg/query-service/app/server.go +++ b/pkg/query-service/app/server.go @@ -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 pprof server", zap.Error(err)) + } }() return nil diff --git a/pkg/query-service/constants/constants.go b/pkg/query-service/constants/constants.go index f4a00cec23..9da032e9ed 100644 --- a/pkg/query-service/constants/constants.go +++ b/pkg/query-service/constants/constants.go @@ -6,7 +6,8 @@ import ( ) const ( - HTTPHostPort = "0.0.0.0:8080" + HTTPHostPort = "0.0.0.0:8080" // Address to serve http (query service) + DebugHttpPort = "0.0.0.0:6060" // Address to serve http (pprof) ) var DEFAULT_TELEMETRY_ANONYMOUS = false