From 9b331aeccab03f4205ab84d000cb02c4abce7af0 Mon Sep 17 00:00:00 2001 From: Mark Philipp Date: Tue, 25 Aug 2026 17:58:42 -0700 Subject: [PATCH] fix(prometheus): align caller identity on latency metrics --- litellm/types/integrations/prometheus.py | 2 ++ .../integrations/test_prometheus_caller_identity.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/types/integrations/prometheus.py b/litellm/types/integrations/prometheus.py index dbd66ffaf5e..2ca299e3520 100644 --- a/litellm/types/integrations/prometheus.py +++ b/litellm/types/integrations/prometheus.py @@ -282,7 +282,9 @@ PROMETHEUS_DEPLOYMENT_AND_LATENCY_CALLER_IDENTITY_METRICS: Final[frozenset[str]] "litellm_deployment_success_responses", "litellm_deployment_failure_responses", "litellm_request_total_latency_metric", + "litellm_llm_api_latency_metric", "litellm_llm_api_time_to_first_token_metric", + "litellm_request_queue_time_seconds", "litellm_overhead_latency_metric", "litellm_deployment_latency_per_output_token", } diff --git a/tests/test_litellm/integrations/test_prometheus_caller_identity.py b/tests/test_litellm/integrations/test_prometheus_caller_identity.py index d7e747e8860..30c1a2e2476 100644 --- a/tests/test_litellm/integrations/test_prometheus_caller_identity.py +++ b/tests/test_litellm/integrations/test_prometheus_caller_identity.py @@ -277,7 +277,10 @@ def test_successful_request_emits_configured_identity_on_real_counter_and_histog "end_time": end_time, "litellm_params": { "custom_llm_provider": "openai", - "metadata": {"model_info": {"id": "deployment-id"}}, + "metadata": { + "model_info": {"id": "deployment-id"}, + "queue_time_seconds": 0.05, + }, }, "standard_logging_object": payload, } @@ -304,7 +307,9 @@ def test_successful_request_emits_configured_identity_on_real_counter_and_histog "litellm_deployment_total_requests_total", "litellm_deployment_success_responses_total", "litellm_request_total_latency_metric_count", + "litellm_llm_api_latency_metric_count", "litellm_llm_api_time_to_first_token_metric_count", + "litellm_request_queue_time_seconds_count", "litellm_overhead_latency_metric_count", "litellm_deployment_latency_per_output_token_count", )