SkyeYoung commented on code in PR #12383:
URL: https://github.com/apache/apisix/pull/12383#discussion_r2222735091


##########
apisix/plugins/prometheus/exporter.lua:
##########
@@ -438,13 +467,7 @@ local function shared_dict_status()
 end
 
 
-local function collect(ctx, stream_only)
-    if not prometheus or not metrics then
-        core.log.error("prometheus: plugin is not initialized, please make 
sure ",
-                     " 'prometheus_metrics' shared dict is present in nginx 
template")
-        return 500, {message = "An unexpected error occurred"}
-    end
-
+local function collect(yieldable)

Review Comment:
   This parameter is currently used to solve the problem of not being able to 
obtain the following data during initialization.
   
   I elaborated in detail in 
https://github.com/apache/apisix/pull/12383#discussion_r2220706155.
   
   <img width="1132" height="706" alt="Image" 
src="https://github.com/user-attachments/assets/5e8c259d-1e3d-4a06-a2bd-9c5c7d4c8e09";
 />



-- 
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]

Reply via email to