Seeking Advice on LibreTranslate Metrics Issue(/metrics) in Kubernetes

Hello everyone,

I recently set up LibreTranslate on my Kubernetes cluster using Helm and enabled the metrics collection (LT_METRICS: true). When checking the /metrics endpoint, I noticed that the data isn’t quite what I expected. The metrics consistently show zero values for http_requests_in_flight, as shown below:

libretranslate_http_requests_in_flight{api_key="",endpoint="/translate",request_ip="127.0.0.1"} 0.0
libretranslate_http_requests_in_flight{api_key="",endpoint="/translate",request_ip="10.132.158.197"} 0.0
libretranslate_http_requests_in_flight{api_key="",endpoint="/translate",request_ip="10.138.47.233"} 0.0
...

It seems that all the request origins are internal IPs, starting with 10, which I’ve verified are related to the ingress controllers in the kube-system namespace. This makes sense, as all requests to the pods typically go through the ingress. However, I’m puzzled why the metric values are always zero.

Could anyone provide some insights or suggestions on how to troubleshoot this issue? Any help would be greatly appreciated.

Thank you!

The inflight metrics will be zero most of the time because they show requests in progress. So unless your server is overloaded and having issues keeping up with requests (or handling long translation requests), the value will be zero.

1 Like

Thank you for your reply. If it is the case, do you mind suggesting me some other way to monitor the request number / request rate?

Use libretranslate_http_request_duration_seconds

1 Like