Files
zeekay b7307d2be9 feat(community): shared builder for standalone + cloud embed; add Server.PublicHandler
Factor the whole SigNoz-community construction (config resolution + the provider
set + the app server) into pkg/community, used by BOTH cmd/community and the
hanzoai/cloud in-process embed. One construction, one way: the embed cannot drift
from the running pod's identity (pkg/identn/iamidentn gateway-header auth) or
wiring because it is the same code.

Add app.Server.PublicHandler() — the built middleware+routes handler WITHOUT
binding the standalone listener — so the cloud binary installs it via
o11y.SetHandler and serves /v1/o11y/* in-process while SigNoz.Start runs
background evaluation.

cmd.NewSigNozConfig now delegates to community.NewConfig (one config path).
2026-07-04 22:35:01 -07:00

22 lines
687 B
Go

package main
import (
"log/slog"
"github.com/hanzoai/o11y/cmd"
"github.com/hanzoai/o11y/pkg/community"
"github.com/hanzoai/o11y/pkg/instrumentation"
)
func main() {
// initialize logger for logging in the cmd/ package. This logger is different from the logger used in the application.
logger := instrumentation.NewLogger(instrumentation.Config{Logs: instrumentation.LogsConfig{Level: slog.LevelInfo}})
// register a list of commands to the root command
registerServer(cmd.RootCmd, logger)
cmd.RegisterGenerate(cmd.RootCmd, logger)
cmd.RegisterMetastore(cmd.RootCmd, logger, community.SQLStoreProviderFactories, community.SQLSchemaProviderFactories)
cmd.Execute(logger)
}