mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 16:19:45 +00:00
[Fix] Merge prometheus_helpers.py into prometheus_helpers/__init__.py to resolve file/package collision
A previous refactor added `litellm/integrations/prometheus_helpers.py` as a sibling to the existing `litellm/integrations/prometheus_helpers/` directory (which contains `prometheus_api.py` and has no `__init__.py`). The file shadowed the namespace-package directory, so any deferred `from litellm.integrations.prometheus_helpers.prometheus_api import ...` raised `ModuleNotFoundError: 'litellm.integrations.prometheus_helpers' is not a package` at request time. Two runtime call sites hit that path: - /global/spend/logs (spend_management_endpoints.py) returned plain-text 500 "Internal Server Error" for every call, breaking the Admin UI Usage tab and programmatic consumers. - SlackAlerting.send_fallback_stats_from_prometheus silently failed inside its own try/except. Fix: move prometheus_helpers.py content into prometheus_helpers/__init__.py and delete the stray .py. The directory becomes a regular package, so both the package-root import (from ...prometheus_helpers import X) and the submodule import (from ...prometheus_helpers.prometheus_api import X) resolve correctly. No call sites change.
This commit is contained in:
Reference in New Issue
Block a user