mirror of
https://github.com/hanzoai/o11y-mcp.git
synced 2026-10-30 18:26:37 +00:00
The three signoz://dashboard/clickhouse-schema-for-* resources published a DDL the warehouse no longer has. Their filter is an allowlist keyed by database signoz_logs/signoz_metrics/signoz_traces and by table name; the collector fork renamed those databases to o11y_* and signoz_index_v3, signoz_spans and signoz_error_index_v2 to o11y_*. filterEssentialTables drops what it cannot find, so traces answered with 12 of its own 18 declared tables under a database header naming one that does not exist, while the resource description promised the three missing by name. A schema that is wrong in a way the reader cannot see is worse than no schema, and it was the only thing pulling hanzoai/otel-collector and the ClickHouse driver into the module graph: 38 dependencies to 18. The clickhouse-*-example resources stay. Those are hand-written prose, and they are honest about being examples. Co-authored-by: Hanzo Dev <[email protected]>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/hanzoai/o11y-mcp/internal/client"
|
|
"github.com/hanzoai/o11y-mcp/internal/config"
|
|
"github.com/hanzoai/o11y-mcp/internal/handler/tools"
|
|
"github.com/hanzoai/o11y-mcp/internal/logger"
|
|
mcpserver "github.com/hanzoai/o11y-mcp/internal/mcp-server"
|
|
)
|
|
|
|
func main() {
|
|
cfg, err := config.LoadConfig()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Failed to load config: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if err := cfg.ValidateConfig(); err != nil {
|
|
fmt.Fprintf(os.Stderr, "Configuration validation failed: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
log, err := logger.NewLogger(logger.LogLevel(cfg.LogLevel))
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Failed to initialize logger: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
log.Info("Starting SigNoz MCP Server",
|
|
zap.String("log_level", cfg.LogLevel),
|
|
zap.String("transport_mode", cfg.TransportMode))
|
|
|
|
sigNozClient := client.NewClient(log, cfg.URL, cfg.APIKey)
|
|
handler := tools.NewHandler(log, sigNozClient, cfg.URL)
|
|
|
|
if err := mcpserver.NewMCPServer(log, handler, cfg).Start(); err != nil {
|
|
log.Fatal(fmt.Sprintf("Failed to start server: %v", err))
|
|
}
|
|
}
|