✨ Integrate monitoring server for observability, adding health and metrics endpoints. Update configuration to enable monitoring features and enhance README with deployment examples for Kubernetes and systemd. Refactor application initialization to include monitoring server setup and improve error handling in message processing metrics.
This commit is contained in:
+8
-2
@@ -127,15 +127,21 @@ func executeListen(c *cli.Context) error {
|
||||
}
|
||||
|
||||
// Initialize dependencies using Wire
|
||||
processor, consumer, err := di.InitializeAppWithConfig(cfg)
|
||||
processor, consumer, monitorServer, err := di.InitializeAppWithConfig(cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to initialize app: %w", err)
|
||||
}
|
||||
|
||||
// Create context with cancellation
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
if monitorServer != nil {
|
||||
if err := monitorServer.Start(ctx); err != nil {
|
||||
return fmt.Errorf("failed to start monitoring server: %w", err)
|
||||
}
|
||||
defer monitorServer.Shutdown(context.Background())
|
||||
}
|
||||
|
||||
// Handle graceful shutdown
|
||||
sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
|
||||
|
||||
Reference in New Issue
Block a user