Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Allow spend /spend/logs endpoint to accept a datetime filter for full log list #7955

Open
rewbs opened this issue Jan 24, 2025 · 4 comments
Labels
enhancement New feature or request mlops user request

Comments

@rewbs
Copy link

rewbs commented Jan 24, 2025

The Feature

I'd like to augment the /spend/logsAPI with a time range filter that allows you to retrieve individual log entries between two datetimes.

PR here: #7956

Sidenote

Currently, the API /spend/logs accepts query parameters start_date and end_date which may, on the surface, appear to provide this functionality already. In fact they provide a different feature altogether:

  • If both parameters are specified, the response is presented as a daily spend aggregate rather than a full list of log events.
  • If the parameters contain a time component as well as the date, the request fails.
  • If either parameter is omitted, the other is ignored.

Motivation, pitch

I'd like to process fine grained usage data based on the full content of the spend logs, which requires datetime-level filtering of those logs. Currently the only way I can do this is by querying the DB directly.

Are you a ML Ops Team?

Yes

Twitter / LinkedIn details

No response

@ishaan-jaff
Copy link
Contributor

we show this on the UI now: #7952

you can use the underlying endpoint there

@rewbs
Copy link
Author

rewbs commented Jan 24, 2025

we show this on the UI now: #7952

you can use the underlying endpoint there

Oh wow thanks, I hadn't noticed there's a whole separate (and much more intuitive) endpoint for the UI to access the logs. The issue with this one aside from the fact that it's not part of the documented API, is that it appears to return results only if prompt and response bodies are logged, which is undesirable for me (I'm only interested in the metadata).

@ishaan-jaff
Copy link
Contributor

nope, my PR updates that. #7952

so from then you can just see your spend logs filtered

@rewbs
Copy link
Author

rewbs commented Jan 24, 2025

OK I see. That'll be useful when it's merged then. Is there a rationale for implementing this in a UI-specific API rather than improving the "official" API? How stable will the UI-specific API be if I decide to integrate with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mlops user request
Projects
None yet
Development

No branches or pull requests

2 participants