增加Prometheus的存储保留

增加Prometheus的存储保留

本文介绍了增加Prometheus的存储保留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的AWS实例上安装了Prometheus服务器,但是15天后数据被自动删除.我需要一年或几个月的数据,我的Prometheus配置是否需要更改?还是我需要像Thanos这样的扩展程序,我是Prometheus的新手,所以请轻松获得答案

Hi I have Prometheus server installed on my AWS instance but the data is been removed automatically after 15 days. I need to have data for an year or months, is there anything I need to change in my prometheus configuration?Or do I need any extensions like Thanos, I am new to Prometheus so please be easy on the answers

推荐答案

启动Prometheus时可以设置--storage.tsdb.retention.time标志.它定义了将数据保留在时间序列数据库(TSDB)中的时间.默认值为15天.

There's the --storage.tsdb.retention.time flag that you can set when you start Prometheus. It defines how long data is kept in the time-series database (TSDB). The default is 15 days.

因此,要将保留时间增加到一年,您应该可以将其设置为:

So, to increase the retention time to a year, you should be able to set this to something like:

--storage.tsdb.retention.time=1y
# or
--storage.tsdb.retention.time=12m

请参见 Prometheus文档.

这篇关于增加Prometheus的存储保留的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:53