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

Allow Specifying retention periods for individual streams. #472

Open
Osama-Kassem opened this issue Nov 21, 2024 · 1 comment
Open

Allow Specifying retention periods for individual streams. #472

Osama-Kassem opened this issue Nov 21, 2024 · 1 comment

Comments

@Osama-Kassem
Copy link

Osama-Kassem commented Nov 21, 2024

Enhancement Proposal

For audit compliance reasons, we'd like to keep a subset of our logs for an extended period of time. We can't set the retention-period config globally, as all logs would be stored for this period, and we'd run out of disk space very quickly. Currently, the charm docs say: Specifying retention periods for individual streams is not currently supported..

This feature is supported by compactor using the retention_stream configuration: https://grafana.com/docs/loki/latest/operations/storage/retention/#retention-configuration

@sed-i
Copy link
Contributor

sed-i commented Dec 20, 2024

Seem like the requirer side could expose retention period as a config option and the loki libs would render a stream selector with the requirer's juju topology.

https://grafana.com/docs/loki/latest/operations/storage/retention/#configuring-the-retention-period

limits_config:
  retention_period: 744h
  retention_stream:
  - selector: '{namespace="dev"}'
    priority: 1
    period: 24h

This is still a bit risky because the requirer charm could technically provide a selector that would match other streams unintentionally.
On the provider side (loki itself) we will be able to render the selector ourselves only if we add to reldata an analogue of scrape_metadata, because CMRs are obfuscated.

We need to take loki-coordinator-k8s into account as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants