mirror of
https://github.com/alibaba/higress.git
synced 2026-02-06 23:21:08 +08:00
add info log of ai-search plugin (#2323)
This commit is contained in:
@@ -362,7 +362,8 @@ func onHttpRequestBody(ctx wrapper.HttpContext, config Config, body []byte, log
|
||||
}, rewriteBody,
|
||||
func(statusCode int, responseHeaders http.Header, responseBody []byte) {
|
||||
if statusCode != http.StatusOK {
|
||||
log.Errorf("search rewrite failed, status: %d", statusCode)
|
||||
log.Errorf("search rewrite failed, status: %d, request url: %s, request cluster: %s, search rewrite model: %s",
|
||||
statusCode, searchRewrite.url, searchRewrite.client.ClusterName(), searchRewrite.modelName)
|
||||
// After a rewrite failure, no further search is performed, thus quickly identifying the failure.
|
||||
proxywasm.ResumeHttpRequest()
|
||||
return
|
||||
|
||||
@@ -38,6 +38,7 @@ type HttpClient interface {
|
||||
Connect(rawURL string, headers [][2]string, body []byte, cb ResponseCallback, timeoutMillisecond ...uint32) error
|
||||
Trace(rawURL string, headers [][2]string, body []byte, cb ResponseCallback, timeoutMillisecond ...uint32) error
|
||||
Call(method, rawURL string, headers [][2]string, body []byte, cb ResponseCallback, timeoutMillisecond ...uint32) error
|
||||
ClusterName() string
|
||||
}
|
||||
|
||||
type ClusterClient[C Cluster] struct {
|
||||
@@ -80,6 +81,8 @@ func (c ClusterClient[C]) Call(method, rawURL string, headers [][2]string, body
|
||||
return HttpCall(c.cluster, method, rawURL, headers, body, cb, timeoutMillisecond...)
|
||||
}
|
||||
|
||||
func (c ClusterClient[C]) ClusterName() string { return c.cluster.ClusterName() }
|
||||
|
||||
func HttpCall(cluster Cluster, method, rawURL string, headers [][2]string, body []byte,
|
||||
callback ResponseCallback, timeoutMillisecond ...uint32) error {
|
||||
for i := len(headers) - 1; i >= 0; i-- {
|
||||
|
||||
Reference in New Issue
Block a user