The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix litellm_overhead_latency_metric
Ishaan Jaffa57b8f68029a
diff --git a/docs/my-website/docs/proxy/prometheus.md b/docs/my-website/docs/proxy/prometheus.mdindex 4c1d6102c58..a0e19a006d0 100644--- a/docs/my-website/docs/proxy/prometheus.md+++ b/docs/my-website/docs/proxy/prometheus.md@@ -135,6 +135,7 @@ Use this for LLM API Error monitoring and tracking remaining rate limits and tok| Metric Name | Description ||----------------------|--------------------------------------|| `litellm_request_total_latency_metric` | Total latency (seconds) for a request to LiteLLM Proxy Server - tracked for labels "end_user", "hashed_api_key", "api_key_alias", "requested_model", "team", "team_alias", "user", "model" |+| `litellm_overhead_latency_metric` | Latency overhead (seconds) added by LiteLLM processing - tracked for labels "end_user", "hashed_api_key", "api_key_alias", "requested_model", "team", "team_alias", "user", "model" || `litellm_llm_api_latency_metric` | Latency (seconds) for just the LLM API call - tracked for labels "model", "hashed_api_key", "api_key_alias", "team", "team_alias", "requested_model", "end_user", "user" || `litellm_llm_api_time_to_first_token_metric` | Time to first token for LLM API call - tracked for labels `model`, `hashed_api_key`, `api_key_alias`, `team`, `team_alias` [Note: only emitted for streaming requests] |diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.pyindex 68d0cdfaf52..908667571c8 100644--- a/litellm/integrations/prometheus.py+++ b/litellm/integrations/prometheus.py@@ -1011,7 +1011,9 @@ class PrometheusLogger(CustomLogger):litellm_model_name,standard_logging_payload["metadata"]["user_api_key_hash"],standard_logging_payload["metadata"]["user_api_key_alias"],- ).observe(litellm_overhead_time_ms)+ ).observe(+ litellm_overhead_time_ms / 1000+ ) # set as secondsif remaining_requests:"""