You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
krr simple fails with history-duration under 24h due to rounding bug in Prometheus query #452
Describe the bug
When running krr simple with --history-duration set to a value less than 24 hours (e.g., 1), the tool fails with a Prometheus API error and does not generate recommendations. It appears that durations under 24 hours are being rounded to 0 days, leading to an invalid PromQL query.
To Reproduce
Steps to reproduce the behavior:
Deploy Prometheus and run a workload in a namespace (e.g., default)
prometheus_api_client.exceptions.PrometheusApiClientException: HTTP Status Code 400
(b'{"status":"error","errorType":"bad_data","error":"invalid parameter \\"query\\": 8:27: parse error: duration must be greater than
0"}')
Expected behavior krr should correctly interpret history durations shorter than 24 hours (e.g., 1, 6) and form valid Prometheus queries.
Screenshots
N/A
Are you interested in contributing a fix for this?
Maybe
Desktop (please complete the following information):
Prometheus version: 2.26.0
prometheus-community/prometheus helm chart version (14.6.0)
Version: krr v1.24.0
Smartphone (please complete the following information):
Activity
dmartzol commentedon Jul 24, 2025
A PR was just opened to fix this issue: #453
dmartzol commentedon Jul 24, 2025
Issue fixed in record time #453 Thank you @arikalon1