mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-26 16:22:02 +08:00
feat(query-service): ✨ integrate pprof
Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
parent
0efb901863
commit
31443dabe7
@ -31,8 +31,9 @@ services:
|
|||||||
query-service:
|
query-service:
|
||||||
image: signoz/query-service:0.7.3
|
image: signoz/query-service:0.7.3
|
||||||
command: ["-config=/root/config/prometheus.yml"]
|
command: ["-config=/root/config/prometheus.yml"]
|
||||||
ports:
|
# ports:
|
||||||
- "8080:8080"
|
# - "6060:6060" # pprof port
|
||||||
|
# - "8080:8080" # query-service port
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus.yml:/root/config/prometheus.yml
|
- ./prometheus.yml:/root/config/prometheus.yml
|
||||||
- ../dashboards:/root/config/dashboards
|
- ../dashboards:/root/config/dashboards
|
||||||
@ -68,7 +69,7 @@ services:
|
|||||||
- "4317:4317" # OTLP gRPC receiver
|
- "4317:4317" # OTLP gRPC receiver
|
||||||
- "4318:4318" # OTLP HTTP receiver
|
- "4318:4318" # OTLP HTTP receiver
|
||||||
# - "8889:8889" # Prometheus metrics exposed by the agent
|
# - "8889:8889" # Prometheus metrics exposed by the agent
|
||||||
# - "13133" # health_check
|
# - "13133:13133" # health_check
|
||||||
# - "14268:14268" # Jaeger receiver
|
# - "14268:14268" # Jaeger receiver
|
||||||
# - "55678:55678" # OpenCensus receiver
|
# - "55678:55678" # OpenCensus receiver
|
||||||
# - "55679:55679" # zpages extension
|
# - "55679:55679" # zpages extension
|
||||||
|
@ -27,6 +27,9 @@ services:
|
|||||||
image: signoz/query-service:0.7.3
|
image: signoz/query-service:0.7.3
|
||||||
container_name: query-service
|
container_name: query-service
|
||||||
command: ["-config=/root/config/prometheus.yml"]
|
command: ["-config=/root/config/prometheus.yml"]
|
||||||
|
# ports:
|
||||||
|
# - "6060:6060" # pprof port
|
||||||
|
# - "8080:8080" # query-service port
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus.yml:/root/config/prometheus.yml
|
- ./prometheus.yml:/root/config/prometheus.yml
|
||||||
- ../dashboards:/root/config/dashboards
|
- ../dashboards:/root/config/dashboards
|
||||||
@ -62,7 +65,7 @@ services:
|
|||||||
- "4317:4317" # OTLP gRPC receiver
|
- "4317:4317" # OTLP gRPC receiver
|
||||||
- "4318:4318" # OTLP HTTP receiver
|
- "4318:4318" # OTLP HTTP receiver
|
||||||
# - "8889:8889" # Prometheus metrics exposed by the agent
|
# - "8889:8889" # Prometheus metrics exposed by the agent
|
||||||
# - "13133" # health_check
|
# - "13133:13133" # health_check
|
||||||
# - "14268:14268" # Jaeger receiver
|
# - "14268:14268" # Jaeger receiver
|
||||||
# - "55678:55678" # OpenCensus receiver
|
# - "55678:55678" # OpenCensus receiver
|
||||||
# - "55679:55679" # zpages extension
|
# - "55679:55679" # zpages extension
|
||||||
|
@ -33,6 +33,9 @@ services:
|
|||||||
image: signoz/query-service:0.7.3
|
image: signoz/query-service:0.7.3
|
||||||
container_name: query-service
|
container_name: query-service
|
||||||
command: ["-config=/root/config/prometheus.yml"]
|
command: ["-config=/root/config/prometheus.yml"]
|
||||||
|
# ports:
|
||||||
|
# - "6060:6060" # pprof port
|
||||||
|
# - "8080:8080" # query-service port
|
||||||
volumes:
|
volumes:
|
||||||
- ./prometheus.yml:/root/config/prometheus.yml
|
- ./prometheus.yml:/root/config/prometheus.yml
|
||||||
- ../dashboards:/root/config/dashboards
|
- ../dashboards:/root/config/dashboards
|
||||||
@ -68,7 +71,7 @@ services:
|
|||||||
- "4317:4317" # OTLP gRPC receiver
|
- "4317:4317" # OTLP gRPC receiver
|
||||||
- "4318:4318" # OTLP HTTP receiver
|
- "4318:4318" # OTLP HTTP receiver
|
||||||
# - "8889:8889" # Prometheus metrics exposed by the agent
|
# - "8889:8889" # Prometheus metrics exposed by the agent
|
||||||
# - "13133" # health_check
|
# - "13133:13133" # health_check
|
||||||
# - "14268:14268" # Jaeger receiver
|
# - "14268:14268" # Jaeger receiver
|
||||||
# - "55678:55678" # OpenCensus receiver
|
# - "55678:55678" # OpenCensus receiver
|
||||||
# - "55679:55679" # zpages extension
|
# - "55679:55679" # zpages extension
|
||||||
|
@ -5,7 +5,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
const HTTPHostPort = "0.0.0.0:8080"
|
const HTTPHostPort = "0.0.0.0:8080" // Address to serve http (query service)
|
||||||
|
const DebugHttpPort = "0.0.0.0:6060" // Address to serve http (pprof)
|
||||||
|
|
||||||
var DruidClientUrl = os.Getenv("DruidClientUrl")
|
var DruidClientUrl = os.Getenv("DruidClientUrl")
|
||||||
var DruidDatasource = os.Getenv("DruidDatasource")
|
var DruidDatasource = os.Getenv("DruidDatasource")
|
||||||
@ -30,7 +31,7 @@ func GetAlertManagerApiPrefix() string {
|
|||||||
return "http://alertmanager:9093/api/"
|
return "http://alertmanager:9093/api/"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alert manager channel subpath
|
// Alert manager channel subpath
|
||||||
var AmChannelApiPath = GetOrDefaultEnv("ALERTMANAGER_API_CHANNEL_PATH", "v1/routes")
|
var AmChannelApiPath = GetOrDefaultEnv("ALERTMANAGER_API_CHANNEL_PATH", "v1/routes")
|
||||||
|
|
||||||
var RELATIONAL_DATASOURCE_PATH = GetOrDefaultEnv("SIGNOZ_LOCAL_DB_PATH", "/var/lib/signoz/signoz.db")
|
var RELATIONAL_DATASOURCE_PATH = GetOrDefaultEnv("SIGNOZ_LOCAL_DB_PATH", "/var/lib/signoz/signoz.db")
|
||||||
@ -47,11 +48,10 @@ const (
|
|||||||
OperationRequest = "operation"
|
OperationRequest = "operation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func GetOrDefaultEnv(key string, fallback string) string {
|
func GetOrDefaultEnv(key string, fallback string) string {
|
||||||
v := os.Getenv(key)
|
v := os.Getenv(key)
|
||||||
if len(v) == 0 {
|
if len(v) == 0 {
|
||||||
return fallback
|
return fallback
|
||||||
}
|
}
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof" // http profiler
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -34,6 +36,10 @@ 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