grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.71k stars 3.42k forks source link

allow to set retention_period=0s for retention_stream #9708

Open makarov-roman opened 1 year ago

makarov-roman commented 1 year ago

Is your feature request related to a problem? Please describe. We have an external requirements to keep specific logs forever

Describe the solution you'd like I wanted to use retention_stream with 0s value to disable retention by selector

Describe alternatives you've considered setting the period to some very high value?

Additional context Example config:

  limits_config:
    retention_period: 14d # https://grafana.com/docs/loki/latest/operations/storage/retention/#configuring-the-retention-period
    retention_stream:
      - selector: '{retention="NO_RETENTION"}'
        priority: 1
        period: 0s # disable
      - selector: '{level="INFO"}'
        priority: 1
        period: 168h
      - selector: '{level="ERROR"}'
        priority: 1
        period: 168h
      - selector: '{level="WARNING"}'
        priority: 1
        period: 24h
      - selector: '{level="DEBUG"}'
        priority: 1
        period: 24h
Quaqmre commented 1 year ago

If this feature gets approved, I'd be thrilled to take on the development task. Count me in! 🚀

dellnoantechnp commented 1 year ago

nice proposal