仅使用基于大小的保留配置时,MaxBlockDuration 为 31 天
作者: richardwilko创建于 2020年2月21日更新于 2026年9月26日
标签help wantedkind/enhancementpriority/P3component/tsdb
cfg.tsdb.MaxBlockDuration 的默认值为 31 天,而不是仅使用基于大小的保留时的 31 天的 10%。问题出现在 prometheus\cmd\prometheus\main.go 的第 313 行,10% 的缩放仅在保留时长为非零时才适用,但仅设置 storage.tsdb.retention.size 时,保留时长为零。
内容来源: prometheus/prometheus