gpt4 book ai didi

prometheus - --storage.tsdb.retention.size 在普罗米修斯

转载 作者:行者123 更新时间:2023-12-04 15:36:37 32 4
gpt4 key购买 nike

我想在 Prometheus 2.12 中尝试 storage.tsdb.retention.size 的特性。

我的 prometheus 保留配置是 90 天或 2GiB。我的预期是当 prometheus 数据目录的大小超过 2GiB 时,它将开始删除数据。但是,现在是 9GB,我可以恢复最旧的数据。

PS:已阅读https://www.robustperception.io/configuring-prometheus-storage-retentionhttps://prometheus.io/docs/prometheus/latest/storage/

我是不是遗漏了什么?

同样在将 storage.tsdb.retention.size 设置为 2GB 时,运行时配置显示保留大小为 2GiB,为什么单位不同?

最佳答案

来自 https://prometheus.io/docs/prometheus/latest/storage/

--storage.tsdb.retention.size: [EXPERIMENTAL] This determines the maximum number of bytes that storage blocks can use (note that this does not include the WAL size, which can be substantial). The oldest data will be removed first. Defaults to 0 or disabled. This flag is experimental and can be changed in future releases. Units supported: KB, MB, GB, PB. Ex: "512MB"

如果我正确阅读了存储 block 的定义:它是度量集合(一个 block )的最大大小,不包括 WAL 和压缩文件。可能是有多个 block 。

还可能取决于所用磁盘空间的很大一部分是否被 WAL 文件使用,因为文档中提到这些文件尚未压缩且相对较大。

您可能想要检查 wal 目录的大小。另外:如果有多个 block ,这些 block 是否限制为 2GB?如果我的理解是正确的,它们可以更小,因为每 2 小时创建一个新 block 。

关于prometheus - --storage.tsdb.retention.size 在普罗米修斯,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59533167/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com