janiussyafiq opened a new pull request, #13659:
URL: https://github.com/apache/apisix/pull/13659

   ### Description
   
   Adds Prometheus metrics for the `ai-cache` plugin (#13578, #13632, #13644), 
integrated in `prometheus/exporter.lua` following the existing `llm_*` metric 
pattern:
   
   - `apisix_ai_cache_hits_total` (with `layer="exact"|"semantic"`), 
`apisix_ai_cache_misses_total`, `apisix_ai_cache_bypasses_total` — counters 
sharing the `llm_*` label set (`route_id`, `service_id`, `consumer`, `node`, 
`request_type`, `request_llm_model`, `llm_model`)
   - `apisix_ai_cache_embedding_latency` — histogram of embedding-call latency 
in milliseconds (the issue sketched `_seconds`, but the exporter's latency 
histograms use milliseconds with `DEFAULT_BUCKETS`, so this follows the house 
convention)
   
   Semantics: Redis fail-open lookups count as MISS; `fail_mode: error` 
rejections record nothing; recording happens in `log` phase and is a silent 
no-op when the `prometheus` plugin is disabled. Docs: label sections added to 
`prometheus.md` (en + zh).
   
   #### Which issue(s) this PR fixes:
   Part of #13290
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)


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