gy09535 commented on a change in pull request #3070:
URL: https://github.com/apache/apisix/pull/3070#discussion_r546480734



##########
File path: apisix/utils/batch-processor.lua
##########
@@ -146,8 +150,20 @@ function batch_processor:push(entry)
         return
     end
 
+    if not batch_metrics and prometheus.get_prometheus() and self.name
+       and self.route_id and self.server_addr then
+        batch_metrics = 
prometheus.get_prometheus():gauge("batch_process_entries",
+                                                          "batch process 
remaining entries",
+                                                          {"name", "route_id", 
"server_addr"})
+    end
+
     local entries = self.entry_buffer.entries
     table.insert(entries, entry)
+    -- add batch metric for every route
+    if batch_metrics  then
+        local label = {self.name, self.route_id, self.server_addr}

Review comment:
       fixed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to