Fix metrics retention size constraint (#252)

* Tweak logging + metrics retention

* Fix broken retentionSize specification

* Tweak to comment

* Increase default log retention to 72h
This commit is contained in:
Matt Pryor 2024-02-13 16:03:32 +00:00 committed by GitHub
parent be4a2f27ed
commit b676959c7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -57,10 +57,11 @@ stringData:
serviceMonitorSelectorNilUsesHelmValues: false
ruleSelectorNilUsesHelmValues: false
{{- if $prometheusVolumeSize }}
# Set the retention size to 95% of the given volume size
# Set the retention size to max 85% of the given volume size, to leave space for the WAL
# To get a valid storage request, we round down to the nearest whole number
{{- $storageAmount := mustRegexFind "^([0-9]*[.])?[0-9]+" $prometheusVolumeSize | float64 }}
{{- $storageUnits := mustRegexFind "(K|M|G|T|E|P)i?$" $prometheusVolumeSize }}
retentionSize: {{ mulf 0.95 $storageAmount }}{{ $storageUnits }}B
retentionSize: {{ mulf 0.85 $storageAmount | floor | int64 }}{{ trimSuffix "i" $storageUnits }}B
{{- end }}
grafana:
sidecar:

View File

@ -223,7 +223,7 @@ monitoring:
compactor:
retention_enabled: true
limits_config:
retention_period: 744h
retention_period: 72h
# Enable persistence by default
persistence:
enabled: true