我们正在试图计算存储需求,但无法找到为Prometheus版本进行计算所需的值(v2.2)。
普罗米修斯(v2.2)存储文档给出了这个简单的公式:
needed_disk_space = retention_time_seconds * ingested_samples_per_second * bytes_per_sample2 592 000秒。rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) / rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])的公式使用本站,但我们没有使用prometheus_tsdb_compaction_chunk_size_bytes_sum,而是使用了prometheus_tsdb_compaction_chunk_size_sum。这给了我们~1.3,听起来差不多。prometheus_local_storage_chunk_ops_total,但是我们没有这个度量。查询和可视化的另一个有用的度量是prometheus_local_storage_chunk_ops_total度量,它报告在Prometheus中发生的所有存储块操作的每秒速率。rate(prometheus_tsdb_head_samples_appended_total[1h]),但结果是~18600表示68TiB存储。将rate(prometheus_tsdb_head_samples_appended_total)与每秒摄入的样本结合起来,您应该能够很好地了解在保留窗口中需要多少磁盘空间。rate(tsdb_samples_appended_total[5m]),但可能意味着(或者我们得到的是) rate(prometheus_tsdb_head_samples_appended_total[5m]),您仍然可以通过速率(Tsdb_samples_appended_total)获得每秒的样本。prometheus_local_storage_ingested_samples_total,但同样,我们无法使用它。抽样率= rate(prometheus_local_storage_ingested_samples_total{job="prometheus",instance="$Prometheus:9090"})rate(prometheus_local_storage_ingested_samples_total[2m]),而且我们再一次无法使用它。另一方面是摄入,这是更容易用能力来推理的。您可以找到您的服务器正在使用以下查询的示例: rate(prometheus_local_storage_ingested_samples_total)任何对正确方向的协助或推动都将是非常感激的。
最后起作用的是的>>>
正如人们所指出的,我们的数学被打破了,所以下面的指标适用于计算。
rate(prometheus_tsdb_head_samples_appended_total[2h])rate(prometheus_tsdb_compaction_chunk_size_sum[2h]) / rate(prometheus_tsdb_compaction_chunk_samples_sum[2h])发布于 2019-09-27 17:37:30
我想你的数学可能是错的。如果您使用~18600号,您会发现我得到的结果与68TiB完全不同:
2,592,000 (seconds) * 18600 (samples/second) * 1.3 (bytes/sample) = 62,674,560,000 (bytes)。这是62.675 by (用1e+9除以数字存储值),我猜你的基础设施应该有一个更合理的数字。
发布于 2021-01-08 19:52:13
要计算Prometheusv2.20 in字节所需的磁盘空间,请使用以下查询:
retention_time_seconds *
rate(prometheus_tsdb_head_samples_appended_total[2h]) *
(rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[2h]) / rate(prometheus_tsdb_compaction_chunk_samples_sum[2h]))其中retention_time_seconds是您为--storage.tsdb.retention.time配置的值,默认为15d = 1296000秒。
https://devops.stackexchange.com/questions/9298
复制相似问题