NighterHunter opened a new issue, #14045:
URL: https://github.com/apache/apisix/issues/14045

   ### Current Behavior
   
   版本:apisix-3.19.0
   [ai-proxy-multi]开启健康检查:
   {
     "name": "xx-监控检查-Anthropic",
     "plugins": {
       "ai-proxy-multi": {
         "balancer": {
           "algorithm": "roundrobin"
         },
         "fallback_strategy": "instance_health_and_rate_limiting",
         "instances": [
           {
             "auth": {
               "header": {
                 "Authorization": "aaa",
                 "x-api-key": "bb"
               }
             },
             "checks": {
               "active": {
                 "healthy": {
                   "interval": 30
                 },
                 "http_method": "POST",
                 "http_path": "/api/coding/v1/messages",
                 "http_req_body": 
"{\"messages\":[{\"role\":\"user\",\"content\":\"0\"}],\"model\":\"GLM-5.3-Flash\",\"max_tokens\":1}",
                 "https_verify_certificate": false,
                 "req_headers": [
                   "x-llm-model: GLM-5.3-Flash"
                 ],
                 "timeout": 30,
                 "type": "https",
                 "unhealthy": {
                   "http_failures": 3,
                   "interval": 10,
                   "timeouts": 3
                 }
               }
             },
             "name": "GLM-5.2-代码助手-火山云-10",
             "options": {
               "model": "GLM-5.3-Flash"
             },
             "override": {
               "endpoint": 
"https://ark.cn-beijing.volces.com/api/coding/v1/messages";
             },
             "priority": 10,
             "provider": "anthropic",
             "weight": 1
           },
           {
             "auth": {
               "header": {
                 "Authorization": "ccc",
                 "x-api-key": "bbb"
               }
             },
             "checks": {
               "active": {
                 "healthy": {
                   "interval": 30
                 },
                 "http_path": "/health",
                 "https_verify_certificate": false,
                 "req_headers": [
                   "x-llm-model: Qwen3.6-28-chat"
                 ],
                 "timeout": 80,
                 "type": "http",
                 "unhealthy": {
                   "http_failures": 3,
                   "interval": 10,
                   "timeouts": 3
                 }
               }
             },
             "name": "Qwen3.6-27B-本地机房",
             "options": {
               "extra_body": {
                 "reasoning_effort": "medium"
               },
               "model": "Qwen3.6-28-chat"
             },
             "override": {
               "endpoint": "http://127.0.0.1:8082/v1/messages";
             },
             "priority": 10,
             "provider": "anthropic",
             "weight": 1
           }
         ],
         "keepalive_timeout": 600000,
         "ssl_verify": false,
         "timeout": 600000
       },
       "key-auth": {
         "header": "Authorization"
       }
     },
     "enable_websocket": true
   }
   
   
请求路由后,然后调用接口/v1/healthcheck,没有返回任何信息,我检查代码,发现这里iter_and_add_healthcheck_info方法有问题,
   local function iter_and_add_healthcheck_info(infos, values)
       if not values then
           return
       end
   
       for _, value in core.config_util.iterate_values(values) do
           local checks = value.value.checks or (value.value.upstream and 
value.value.upstream.checks)
           if checks then
               local info = extra_checker_info(value)
               info.type = get_checker_type(checks)
               core.table.insert(infos, info)
           end
       end
   end
   
   checks是在  
value.value.ai-proxy-multi.instances.checks,所以这里的checks一直是nil,导致接口一直没有返回信息
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   nothing
   
   ### Environment
   
   apisix-3.19.0
   


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