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

Delete container logs older than one day #90

Open
lippserd opened this issue May 26, 2024 · 0 comments
Open

Delete container logs older than one day #90

lippserd opened this issue May 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lippserd
Copy link
Member

We already delete events that are older than one day to prevent the database from growing indefinitely. This should also be done for container logs. But this is not possible with our current schema, as the logs are a single field with no reference to time frames.

Maybe the following will work, please verify: Instead of always concatenating container logs, we could split them by hours:

  • Introduce a new column indicating the start for the logs collected during this period, e.g. period.
  • Calculate period by $time - $time % 3600. Note that we're working with millisecond timestamps.
  • Use LastUpdate to decide whether to set or concat Logs.
  • Since we now have several rows per container in the database, the primary key of the table must be adjusted, as well as the select statement for the warm-up phase, since it must provide the latest timestamp per container.
  • Delete container logs that are older than one day. Have a look at how it's done for events.
  • Change Web accordingly.
@lippserd lippserd added the enhancement New feature or request label Aug 25, 2024
@lippserd lippserd added this to the 0.3.0 milestone Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants