Skip to content

Instantly share code, notes, and snippets.

@shyamvyas5
Created October 13, 2023 04:33
Show Gist options
  • Save shyamvyas5/745ba1639b1c77e889671b7b614b18b6 to your computer and use it in GitHub Desktop.
Save shyamvyas5/745ba1639b1c77e889671b7b614b18b6 to your computer and use it in GitHub Desktop.
prometheus needed disk space calculation based on number of samples ingested and calculating bytes per sample alongwith retention period

query to calculate the storage space required for Prometheus

1296000 * (rate(prometheus_tsdb_head_samples_appended_total[1d]) *
(rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[1d]) / rate(prometheus_tsdb_compaction_chunk_samples_sum[1d])))

1296000 = retention period in seconds(15 days here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment