From bbc702cd8be9025c405e4789f37aa24ec45c7159 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 14:09:40 -0700 Subject: [PATCH] fix(gateway): expose /api/event_logging/batch on the gateway allowlist (#42572) * fix(gateway): expose /api/event_logging/batch on the gateway allowlist Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(gateway): route /api/event_logging to gateway pods in helm and terraform Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(proxy): stop max_budget leaking between proxy_server and native_compaction tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: kerry Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- gateway/routes/allowlist.py | 1 + helm/litellm/templates/ingress.yaml | 2 +- terraform/litellm/aws/locals.tf | 2 +- terraform/litellm/gcp/locals.tf | 2 +- tests/test_litellm/proxy/test_native_compaction.py | 1 + tests/test_litellm/proxy/test_proxy_server.py | 12 ++++++------ 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gateway/routes/allowlist.py b/gateway/routes/allowlist.py index fe58e2dd58c..c4a3d3f7473 100644 --- a/gateway/routes/allowlist.py +++ b/gateway/routes/allowlist.py @@ -131,6 +131,7 @@ GATEWAY_EXACT_PATHS: frozenset[str] = frozenset( "/redoc", "/test", "/debug/memory/summary", + "/api/event_logging/batch", } ) diff --git a/helm/litellm/templates/ingress.yaml b/helm/litellm/templates/ingress.yaml index e6717821a57..e9f7ed4ec3f 100644 --- a/helm/litellm/templates/ingress.yaml +++ b/helm/litellm/templates/ingress.yaml @@ -61,7 +61,7 @@ "/v1/fine-tuning" "/fine-tuning" "/v1/responses" "/responses" "/v1/threads" "/threads" "/v1/assistants" "/assistants" "/v1/vector_stores" "/vector_stores" "/v1/indexes" "/v1/models" "/models" "/openai" "/engines" - "/v1/messages" "/messages" "/v1/skills" "/v1/a2a" "/a2a" + "/v1/messages" "/messages" "/v1/skills" "/v1/a2a" "/a2a" "/api/event_logging" "/v1/rerank" "/v2/rerank" "/rerank" "/v1/ocr" "/ocr" "/v1/rag" "/rag" "/v1/video" "/v1/videos" "/video" "/videos" "/v1/search" "/search" "/v1/containers" "/containers" "/v1/evals" "/v1/memory" "/queue/chat" diff --git a/terraform/litellm/aws/locals.tf b/terraform/litellm/aws/locals.tf index 778d31642c1..b89bd486d02 100644 --- a/terraform/litellm/aws/locals.tf +++ b/terraform/litellm/aws/locals.tf @@ -74,7 +74,7 @@ locals { "/v1/models*", "/models*", "/openai/*", "/engines/*", "/v1/messages*", "/messages*", - "/v1/skills/*", "/v1/a2a/*", + "/v1/skills/*", "/v1/a2a/*", "/api/event_logging*", "/v1/rerank*", "/v2/rerank*", "/rerank*", "/v1/ocr*", "/ocr*", "/v1/rag/*", "/rag/*", diff --git a/terraform/litellm/gcp/locals.tf b/terraform/litellm/gcp/locals.tf index d263c781449..e82892b27cb 100644 --- a/terraform/litellm/gcp/locals.tf +++ b/terraform/litellm/gcp/locals.tf @@ -43,7 +43,7 @@ locals { "/v1/models*", "/models*", "/openai/*", "/engines/*", "/v1/messages*", "/messages*", - "/v1/skills/*", "/v1/a2a/*", + "/v1/skills/*", "/v1/a2a/*", "/api/event_logging*", "/v1/rerank*", "/v2/rerank*", "/rerank*", "/v1/ocr*", "/ocr*", "/v1/rag/*", "/rag/*", diff --git a/tests/test_litellm/proxy/test_native_compaction.py b/tests/test_litellm/proxy/test_native_compaction.py index 9a6b4cdda65..778c1715530 100644 --- a/tests/test_litellm/proxy/test_native_compaction.py +++ b/tests/test_litellm/proxy/test_native_compaction.py @@ -116,6 +116,7 @@ async def test_real_proxy_child_auth_privacy_and_body_policy( monkeypatch.setattr(litellm, "max_budget", 0) monkeypatch.setattr(proxy_server.app, "dependency_overrides", {}) monkeypatch.setattr(proxy_server, "master_key", "sk-master-fixture") + monkeypatch.setattr(litellm, "max_budget", 0.0) monkeypatch.setattr(proxy_server, "prisma_client", object()) monkeypatch.setattr(proxy_server, "user_api_key_cache", cache) monkeypatch.setattr(proxy_server, "llm_router", None) diff --git a/tests/test_litellm/proxy/test_proxy_server.py b/tests/test_litellm/proxy/test_proxy_server.py index 26bfd5c52bd..32b89885ac2 100644 --- a/tests/test_litellm/proxy/test_proxy_server.py +++ b/tests/test_litellm/proxy/test_proxy_server.py @@ -3200,7 +3200,7 @@ def test_normalize_datetime_for_sorting(): @pytest.mark.asyncio -async def test_add_proxy_budget_to_db_only_creates_user_no_keys(): +async def test_add_proxy_budget_to_db_only_creates_user_no_keys(monkeypatch: pytest.MonkeyPatch): """ Test that _add_proxy_budget_to_db only creates a user and no keys are added. @@ -3218,8 +3218,8 @@ async def test_add_proxy_budget_to_db_only_creates_user_no_keys(): from litellm.proxy.proxy_server import ProxyStartupEvent # Set up required litellm settings - litellm.budget_duration = "30d" - litellm.max_budget = 100.0 + monkeypatch.setattr(litellm, "budget_duration", "30d") + monkeypatch.setattr(litellm, "max_budget", 100.0) litellm_proxy_budget_name = "litellm-proxy-budget" @@ -3258,7 +3258,7 @@ async def test_add_proxy_budget_to_db_only_creates_user_no_keys(): @pytest.mark.asyncio -async def test_add_proxy_budget_to_db_backfills_budget_reset_at(): +async def test_add_proxy_budget_to_db_backfills_budget_reset_at(monkeypatch: pytest.MonkeyPatch): """ Test that _upsert_proxy_budget_with_reset_at_backfill issues a conditional update_many with `WHERE budget_reset_at IS NULL` to backfill the column on @@ -3276,8 +3276,8 @@ async def test_add_proxy_budget_to_db_backfills_budget_reset_at(): import litellm from litellm.proxy.proxy_server import ProxyStartupEvent - litellm.budget_duration = "30d" - litellm.max_budget = 100.0 + monkeypatch.setattr(litellm, "budget_duration", "30d") + monkeypatch.setattr(litellm, "max_budget", 100.0) litellm_proxy_budget_name = "litellm-proxy-budget" mock_prisma = MagicMock()