Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions litellm/proxy/health_endpoints/_health_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _resolve_os_environ_variables(params: dict) -> dict:
"email",
"braintrust",
"datadog",
"datadog_llm_observability",
"generic_api",
"arize",
"sqs"
Expand Down Expand Up @@ -190,6 +191,7 @@ async def health_services_endpoint( # noqa: PLR0915
"custom_callback_api",
"langsmith",
"datadog",
"datadog_llm_observability",
"generic_api",
"arize",
"sqs"
Expand Down
37 changes: 37 additions & 0 deletions tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,43 @@ def mock_resolve_os_environ(params):
assert "result" in result


@pytest.mark.asyncio
async def test_health_services_endpoint_datadog_llm_observability():
"""
Verify that 'datadog_llm_observability' is accepted as a valid service
by the /health/services endpoint and does not raise a 400 error.

Regression test for: https://github.com/BerriAI/litellm/issues/XXXX
The service was missing from the allowed services validation list.
"""
from litellm.proxy.health_endpoints._health_endpoints import (
health_services_endpoint,
)

# Mock datadog_llm_observability to be in success_callback so the generic branch handles it
with patch("litellm.success_callback", ["datadog_llm_observability"]):
result = await health_services_endpoint(
service="datadog_llm_observability"
)

# Should not raise HTTPException(400) and should return success
assert result["status"] == "success"
assert "datadog_llm_observability" in result["message"]


@pytest.mark.asyncio
async def test_health_services_endpoint_rejects_unknown_service():
"""
Verify that an unknown service name is rejected with a 400 error.
"""
from litellm.proxy._types import ProxyException

with pytest.raises(ProxyException):
await health_services_endpoint(
service="totally_unknown_service_xyz"
)


@pytest.fixture(scope="function")
def proxy_client(monkeypatch):
"""
Expand Down
Loading