mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
AI observability upgrade (#1587)
Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
@@ -74,6 +74,9 @@ func processCacheHit(key string, response string, stream bool, ctx wrapper.HttpC
|
||||
|
||||
ctx.SetContext(CACHE_KEY_CONTEXT_KEY, nil)
|
||||
|
||||
ctx.SetUserAttribute("cache_status", "hit")
|
||||
ctx.WriteUserAttributeToLogWithKey(wrapper.AILogKey)
|
||||
|
||||
if stream {
|
||||
proxywasm.SendHttpResponseWithDetail(200, "ai-cache.hit", [][2]string{{"content-type", "text/event-stream; charset=utf-8"}}, []byte(fmt.Sprintf(c.StreamResponseTemplate, escapedResponse)), -1)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user