mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
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).
22 lines
687 B
Go
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)
|
|
}
|