Skip to content

Commit 8296bfb

Browse files
committed
fix: test metrics
1 parent c6afa90 commit 8296bfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/otel_tests/test_prometheus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async def test_proxy_failure_metrics():
106106
print("/metrics", metrics)
107107

108108
# Check if the failure metric is present and correct - use pattern matching for robustness
109-
expected_metric_pattern = 'litellm_proxy_failed_requests_metric_total{api_key_alias="None",end_user="None",exception_class="Openai.RateLimitError",exception_status="429",hashed_api_key="88dc28d0f030c55ed4ab77ed8faf098196cb1c05df778539800c9f1243fe6b4b",requested_model="fake-azure-endpoint",route="/chat/completions",team="None",team_alias="None",user="default_user_id"}'
109+
expected_metric_pattern = 'litellm_proxy_failed_requests_metric_total{api_key_alias="None",end_user="None",exception_class="Openai.RateLimitError",exception_status="429",hashed_api_key="88dc28d0f030c55ed4ab77ed8faf098196cb1c05df778539800c9f1243fe6b4b",requested_model="fake-azure-endpoint",route="/chat/completions",team="None",team_alias="None",user="default_user_id",user_email="None"}'
110110

111111
# Check if the pattern is in metrics (this metric doesn't include user_email field)
112112
assert any(expected_metric_pattern in line for line in metrics.split('\n')), f"Expected failure metric pattern not found in /metrics. Pattern: {expected_metric_pattern}"

0 commit comments

Comments
 (0)