From 0976fbc6c40890a2433cfcd4c955f27570634e68 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Mon, 4 May 2026 20:54:54 -0700 Subject: [PATCH] [Fix] Tests: Restore /metrics access for prometheus test suite /metrics now requires auth by default; tests/otel_tests/test_prometheus.py makes 4+ unauthenticated GETs against http://0.0.0.0:4000/metrics, so every prometheus test in CI now fails the metric assertion. Set require_auth_for_metrics_endpoint: false in otel_test_config.yaml to opt out for this test job, which scrapes /metrics directly. Verified locally: 8/8 prometheus tests green (one flaky retry on test_proxy_success_metrics that pre-dates this PR). Also drop the -x stop-on-first-failure flag from the otel test command so all failures in the job surface in a single CI run rather than hiding behind whichever one trips first. --- .circleci/config.yml | 2 +- litellm/proxy/example_config_yaml/otel_test_config.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a883c07021f..b91143f06fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1475,7 +1475,7 @@ jobs: - run: name: Run tests command: | - uv run --no-sync python -m pytest -v tests/otel_tests -x --junitxml=test-results/junit.xml --durations=5 + uv run --no-sync python -m pytest -v tests/otel_tests --junitxml=test-results/junit.xml --durations=5 no_output_timeout: 15m # Clean up first container - run: diff --git a/litellm/proxy/example_config_yaml/otel_test_config.yaml b/litellm/proxy/example_config_yaml/otel_test_config.yaml index fc506a792eb..dc612865732 100644 --- a/litellm/proxy/example_config_yaml/otel_test_config.yaml +++ b/litellm/proxy/example_config_yaml/otel_test_config.yaml @@ -46,6 +46,9 @@ litellm_settings: cache: true callbacks: ["otel", "prometheus"] disable_end_user_cost_tracking_prometheus_only: True + # /metrics auth is on by default; tests/otel_tests/test_prometheus.py + # scrapes the endpoint without credentials, so opt out here. + require_auth_for_metrics_endpoint: False guardrails: - guardrail_name: "bedrock-pre-guard"