@@ -48,7 +48,7 @@ const (
4848 QueueFullTimeout = 100 * time .Millisecond
4949)
5050
51- func InitializeQueue () {
51+ func initializeQueue () {
5252 ctx , cancel := context .WithCancel (context .Background ())
5353
5454 alertQueue = & AlertQueue {
@@ -67,7 +67,7 @@ func InitializeQueue() {
6767
6868}
6969
70- func EnqueueAlert (alert * plugins.Alert ) bool {
70+ func enqueueAlert (alert * plugins.Alert ) bool {
7171 if alertQueue == nil {
7272 return false
7373 }
@@ -97,10 +97,6 @@ func EnqueueAlert(alert *plugins.Alert) bool {
9797 "total_dropped" : totalDropped ,
9898 "consecutive_drops" : consecutiveDrops ,
9999 })
100- catcher .Error (fmt .Sprintf ("QUEUE FULL - Alert %s DROPPED! Queue size: %d/%d, Total dropped: %d, Consecutive: %d." ,
101- alert .Id , currentQueueSize , DefaultQueueSize , totalDropped , consecutiveDrops ),
102- nil , map [string ]any {"process" : "plugin_com.utmstack.soc-ai" },
103- )
104100
105101 elastic .RegisterError (fmt .Sprintf ("Alert dropped - Queue FULL (%d/%d)" , currentQueueSize , DefaultQueueSize ), alert .Id )
106102 alertQueue .lastDropAlert = time .Now ()
@@ -187,8 +183,13 @@ func (aq *AlertQueue) metricsLogger() {
187183 errors := atomic .LoadInt64 (& aq .errorCount )
188184 queueSize := atomic .LoadInt64 (& aq .queueSize )
189185
190- catcher .Info (fmt .Sprintf ("Queue metrics - Processed: %d, Dropped: %d, Errors: %d, Current queue size: %d" ,
191- processed , dropped , errors , queueSize ), map [string ]any {"process" : "plugin_com.utmstack.soc-ai" })
186+ catcher .Info ("SOC-AI queue metrics" , map [string ]any {
187+ "process" : "plugin_com.utmstack.soc-ai" ,
188+ "processed" : processed ,
189+ "dropped" : dropped ,
190+ "errors" : errors ,
191+ "queueSize" : queueSize ,
192+ })
192193 }
193194 }
194195}
0 commit comments