membphis commented on a change in pull request #1607:
URL: https://github.com/apache/incubator-apisix/pull/1607#discussion_r429983280
##########
File path: apisix/plugins/prometheus/exporter.lua
##########
@@ -32,10 +33,29 @@ local DEFAULT_BUCKETS = { 1, 2, 5, 7, 10, 15, 20, 25, 30,
40, 50, 60, 70,
local metrics = {}
-local _M = {version = 0.3}
+ local inner_tab_arr = {}
+ local clear_tab = core.table.clear
+local function gen_arr(...)
+ clear_tab(inner_tab_arr)
+
+ for i = 1, select('#', ...) do
+ inner_tab_arr[i] = select(i, ...)
+ end
+
+ return inner_tab_arr
+end
+
+
+local _M = {}
function _M.init()
+ -- todo: support hot reload, we may need to update the lua-prometheus
Review comment:
I have created an issue, fix this later
##########
File path: apisix/plugins/prometheus/exporter.lua
##########
@@ -32,10 +33,29 @@ local DEFAULT_BUCKETS = { 1, 2, 5, 7, 10, 15, 20, 25, 30,
40, 50, 60, 70,
local metrics = {}
-local _M = {version = 0.3}
+ local inner_tab_arr = {}
+ local clear_tab = core.table.clear
+local function gen_arr(...)
+ clear_tab(inner_tab_arr)
+
+ for i = 1, select('#', ...) do
+ inner_tab_arr[i] = select(i, ...)
+ end
+
+ return inner_tab_arr
+end
+
+
+local _M = {}
function _M.init()
+ -- todo: support hot reload, we may need to update the lua-prometheus
Review comment:
I have created an issue, fix this later
https://github.com/apache/incubator-apisix/issues/1610
----------------------------------------------------------------
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]