janiussyafiq commented on code in PR #13909:
URL: https://github.com/apache/apisix/pull/13909#discussion_r3920741669


##########
apisix/plugins/prometheus/exporter.lua:
##########
@@ -771,18 +778,22 @@ function _M.http_log(conf, ctx)
 
     local latency_extra_label_values = extra_labels("http_latency", ctx)
 
-    metrics.latency:observe(latency,
-        get_enabled_label_values_for_metric("http_latency", 
disabled_label_metric_map,
-            "request", route_id, service_id, consumer_name, balancer_ip,
-            vars.request_type, request_llm_model_label, llm_model_label,
-            unpack(latency_extra_label_values)))
+    local skip_session_latency = tonumber(vars.status) == 101 and 
exclude_websocket_latency()

Review Comment:
   I think it's a better and cleaner approach.
   Similar to your suggestion but instead of adding a new protocol label, could 
we simply add websocket to the existing `request_type` which currently holds 
`traditional_http, ai_chat, ai_stream`?



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