Skip to content

Commit

Permalink
chore: add option skip web
Browse files Browse the repository at this point in the history
Fixes #6711
  • Loading branch information
srikanthccv committed Dec 31, 2024
1 parent 03fb388 commit d7bc1fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions ee/query-service/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type ServerOptions struct {
GatewayUrl string
UseLogsNewSchema bool
UseTraceNewSchema bool
SkipWebFrontend bool
}

// Server runs HTTP api service
Expand Down Expand Up @@ -383,9 +384,11 @@ func (s *Server) createPublicServer(apiHandler *api.APIHandler, web *web.Web) (*

handler = handlers.CompressHandler(handler)

err := web.AddToRouter(r)
if err != nil {
return nil, err
if !s.serverOptions.SkipWebFrontend {
err := web.AddToRouter(r)
if err != nil {
return nil, err
}
}

return &http.Server{
Expand Down
6 changes: 4 additions & 2 deletions ee/query-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func main() {
var dialTimeout time.Duration
var gatewayUrl string
var useLicensesV3 bool
var skipWebFrontend bool

flag.BoolVar(&useLogsNewSchema, "use-logs-new-schema", false, "use logs_v2 schema for logs")
flag.BoolVar(&useTraceNewSchema, "use-trace-new-schema", false, "use new schema for traces")
Expand All @@ -125,7 +126,7 @@ func main() {
flag.StringVar(&cluster, "cluster", "cluster", "(cluster name - defaults to 'cluster')")
flag.StringVar(&gatewayUrl, "gateway-url", "", "(url to the gateway)")
flag.BoolVar(&useLicensesV3, "use-licenses-v3", false, "use licenses_v3 schema for licenses")

flag.BoolVar(&skipWebFrontend, "skip-web-frontend", false, "skip web frontend")
flag.Parse()

loggerMgr := initZapLog(enableQueryServiceLogOTLPExport)
Expand All @@ -148,7 +149,7 @@ func main() {
}

web, err := signozweb.New(zap.L(), config.Web)
if err != nil {
if err != nil && !skipWebFrontend {
zap.L().Fatal("Failed to create web", zap.Error(err))
}

Expand All @@ -169,6 +170,7 @@ func main() {
GatewayUrl: gatewayUrl,
UseLogsNewSchema: useLogsNewSchema,
UseTraceNewSchema: useTraceNewSchema,
SkipWebFrontend: skipWebFrontend,
}

// Read the jwt secret key
Expand Down

0 comments on commit d7bc1fa

Please sign in to comment.