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

Add request_id field to the log deletion API #11613

Closed
afarresg opened this issue Jan 9, 2024 · 0 comments
Closed

Add request_id field to the log deletion API #11613

afarresg opened this issue Jan 9, 2024 · 0 comments

Comments

@afarresg
Copy link

afarresg commented Jan 9, 2024

Describe the bug
As of right now, Loki doesn't seem to support size-based retention policies (#7927 is in progress), so we have implemented a script that monitors the size of a Kubernetes persistent volume and sends log deletion requests to remove the oldest logs. We essentially send a deletion request to /loki/api/v1/delete and then wait until the latest request is marked as processed.

It would be interesting if the API could return a field like request_id when sending the request so upon fetching the list of deletion requests one could safely track the actual status. Right now, these are the fields that represent a request:

{
  "request_id": "[...]",
  "start_time": [...],
  "end_time": [...],
  "query": "[...]",
  "status": "[...]",
  "created_at": [...]
},

To Reproduce
Steps to reproduce the behavior:

  1. Send a POST request to /loki/api/v1/delete with the range of time
  2. Send a GET request to list all the requests

Expected behavior
A field request_id is returned when POSTing, and this same field is available when GETing.

Environment:

  • Infrastructure: Kubernetes
  • Deployment tool: Helm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant