mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +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",
|
"Total latency (seconds) for a request to LiteLLM",
|
||||||
labelnames=[
|
labelnames=[
|
||||||
"model",
|
"model",
|
||||||
"litellm_call_id",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,7 +74,6 @@ class PrometheusLogger(CustomLogger):
|
||||||
"Total latency (seconds) for a models LLM API call",
|
"Total latency (seconds) for a models LLM API call",
|
||||||
labelnames=[
|
labelnames=[
|
||||||
"model",
|
"model",
|
||||||
"litellm_call_id",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -357,13 +355,11 @@ class PrometheusLogger(CustomLogger):
|
||||||
|
|
||||||
api_call_total_time_seconds = api_call_total_time.total_seconds()
|
api_call_total_time_seconds = api_call_total_time.total_seconds()
|
||||||
|
|
||||||
litellm_call_id = kwargs.get("litellm_call_id")
|
# log metrics
|
||||||
|
self.litellm_request_total_latency_metric.labels(model).observe(
|
||||||
self.litellm_request_total_latency_metric.labels(
|
total_time_seconds
|
||||||
model, litellm_call_id
|
)
|
||||||
).observe(total_time_seconds)
|
self.litellm_llm_api_latency_metric.labels(model).observe(
|
||||||
|
|
||||||
self.litellm_llm_api_latency_metric.labels(model, litellm_call_id).observe(
|
|
||||||
api_call_total_time_seconds
|
api_call_total_time_seconds
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue