Grafana shows only 15 days of metrics instead of 90 days

I’m using Grafana to visualize CPU, memory, and disk metrics from Prometheus using Node Exporter as the data source. However, I noticed that my Grafana dashboard only displays historical data for the past 15 days, even though I’ve already configured the data retention period to 90 days in Prometheus.

Could you please help me understand what might be causing this issue?
Is there a way to verify or troubleshoot whether the data retention settings are actually applied, or if old data is being deleted due to storage limits or other configurations?

Welcome @feetee00500 to the Grafana forum.

Which version of Grafana are you using (Cloud or OSS)? If Cloud, are you on a paid tier? The free tier’s storage of Metrics is limited to 14 days, regardless of what your Prometheus settings are.

I am using Grafana (OSS) installed in a Docker container on my on-premises system. As you mentioned:

  1. Grafana (OSS) stores data for a maximum of 15 days — is that correct?

  2. Grafana (OSS) can store unlimited data depending on the Prometheus configuration — is that correct?

If I don’t understand, please explain it to me again. If I want to store data for up to 90 days in the past, what should I do?

Hi @feetee00500 Grafana (Cloud or OSS) does not store any data. You connect it to a datasource of your choice. That datasource can hold 5 minutes or 5 decades of data depending on how you configure it.

It sounds like your Prometheus datasource is also on-prem. By default, Prometheus stores data for 15 days and you can change this by changing the retention period, which is controlled by a command-line flag you set when starting Prometheus.

You can control data retention in Prometheus using two primary flags:

  • Time-Based Retention: Use the --storage.tsdb.retention.time flag to set how long to keep data. You can use units like d for days, w for weeks, and y for years.

  • Size-Based Retention: Use the --storage.tsdb.retention.size flag to set a maximum size for the storage blocks (e.g., 50GB).

If you set both flags, Prometheus will delete data whenever the first limit is reached.