forked from phoenix/litellm-mirror
(feat) use clickhouse for /spend/logs
This commit is contained in:
parent
dc5942f6aa
commit
c1f9703734
1 changed files with 11 additions and 0 deletions
|
@ -3782,6 +3782,17 @@ async def view_spend_logs(
|
||||||
-H "Authorization: Bearer sk-1234"
|
-H "Authorization: Bearer sk-1234"
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
if os.getenv("CLICKHOUSE_HOST") is not None:
|
||||||
|
# gettting spend logs from clickhouse
|
||||||
|
from litellm.proxy.enterprise.utils import view_spend_logs_from_clickhouse
|
||||||
|
|
||||||
|
return await view_spend_logs_from_clickhouse(
|
||||||
|
api_key=api_key,
|
||||||
|
user_id=user_id,
|
||||||
|
request_id=request_id,
|
||||||
|
start_date=start_date,
|
||||||
|
end_date=end_date,
|
||||||
|
)
|
||||||
global prisma_client
|
global prisma_client
|
||||||
try:
|
try:
|
||||||
verbose_proxy_logger.debug("inside view_spend_logs")
|
verbose_proxy_logger.debug("inside view_spend_logs")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue