mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix prom latency metrics
This commit is contained in:
parent
52fb1e0c38
commit
4ac78a0765
1 changed files with 5 additions and 9 deletions
|
@ -66,7 +66,6 @@ class PrometheusLogger(CustomLogger):
|
|||
"Total latency (seconds) for a request to LiteLLM",
|
||||
labelnames=[
|
||||
"model",
|
||||
"litellm_call_id",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -75,7 +74,6 @@ class PrometheusLogger(CustomLogger):
|
|||
"Total latency (seconds) for a models LLM API call",
|
||||
labelnames=[
|
||||
"model",
|
||||
"litellm_call_id",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -357,13 +355,11 @@ class PrometheusLogger(CustomLogger):
|
|||
|
||||
api_call_total_time_seconds = api_call_total_time.total_seconds()
|
||||
|
||||
litellm_call_id = kwargs.get("litellm_call_id")
|
||||
|
||||
self.litellm_request_total_latency_metric.labels(
|
||||
model, litellm_call_id
|
||||
).observe(total_time_seconds)
|
||||
|
||||
self.litellm_llm_api_latency_metric.labels(model, litellm_call_id).observe(
|
||||
# log metrics
|
||||
self.litellm_request_total_latency_metric.labels(model).observe(
|
||||
total_time_seconds
|
||||
)
|
||||
self.litellm_llm_api_latency_metric.labels(model).observe(
|
||||
api_call_total_time_seconds
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue