Skip to content

feat(logging): add support for parametric logs retention in Loki #396

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

Merged
merged 6 commits into from
Apr 24, 2025

Conversation

stefanoghinelli
Copy link
Member

@stefanoghinelli stefanoghinelli commented Apr 23, 2025

Summary 💡

This PR adds support for logs retention in the Loki configuration using the compactor component, as specified in the Loki official documentation. This implementation follows the recommended approach for TSDB-based storage.

Closes: sighupio/module-logging#177

Description 📝

The change includes:

  • Support for global retention via the retention_period setting under limits_config
  • Removal of table_manager (deprecated) configuration block
  • Usage of the existing persistentvolumeclaim/data-loki-distributed-compactor as the working directory for the compactor

Breaking Changes 💔

None.

Tests performed 🧪

  • Tested the addition of the retention with SD version 1.31.1
  • Checked that logs older than configured period are deleted by the compactor
  • Tested the disabling of the retention with SD version 1.31.1

Future work 🔧

None.

@stefanoghinelli stefanoghinelli self-assigned this Apr 23, 2025
@stefanoghinelli stefanoghinelli changed the title feat(logging): add retention configurtions to Loki feat(logging): add retention configurations to Loki Apr 23, 2025
@stefanoghinelli stefanoghinelli marked this pull request as ready for review April 23, 2025 14:01
@stefanoghinelli stefanoghinelli changed the title feat(logging): add retention configurations to Loki feat(logging): add support for parametric logs retention in Loki Apr 23, 2025
Copy link
Member

@ralgozino ralgozino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@lukeskywlkr lukeskywlkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@stefanoghinelli stefanoghinelli merged commit 955e688 into main Apr 24, 2025
1 check passed
@stefanoghinelli stefanoghinelli deleted the feat/add-retention-to-loki branch April 24, 2025 10:18
@kriive kriive mentioned this pull request May 19, 2025
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

Successfully merging this pull request may close these issues.

[Loki] Add a configurable parameter for logs retention
3 participants