SkyeYoung commented on code in PR #12383:
URL: https://github.com/apache/apisix/pull/12383#discussion_r2224569962
##########
apisix/plugin.lua:
##########
@@ -808,18 +797,18 @@ do
end
-function _M.init_worker()
+function _M.init_prometheus()
local _, http_plugin_names, stream_plugin_names = get_plugin_names()
+ local enabled_in_http = core.table.array_find(http_plugin_names,
"prometheus")
+ local enabled_in_stream = core.table.array_find(stream_plugin_names,
"prometheus")
- -- some plugins need to be initialized in init* phases
- if is_http and core.table.array_find(http_plugin_names, "prometheus") then
- local prometheus_enabled_in_stream =
- core.table.array_find(stream_plugin_names, "prometheus")
-
require("apisix.plugins.prometheus.exporter").http_init(prometheus_enabled_in_stream)
- elseif not is_http and core.table.array_find(stream_plugin_names,
"prometheus") then
- require("apisix.plugins.prometheus.exporter").stream_init()
+ if is_http and (enabled_in_http or enabled_in_stream) then
Review Comment:
@bzp2010 I think this part of the code can be found by modifying the
history, just like the old code.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]