This will give you a hint on which metrics that has the highest cardinality.
topk(10, count by (__name__, job)({__name__=~".+"}))
Formula:
needed_disk_space = retention_time_seconds * ingested_samples_per_second * bytes_per_sample
Metrics example:
retention_time_seconds
:864000
(10 days)
prometheus_tsdb_retention_limit_seconds
ingested_samples_per_second
:21359.936262203624
rate(prometheus_tsdb_head_samples_appended_total[2h])
bytes_per_sample
:1.640350514654668
rate(prometheus_tsdb_compaction_chunk_size_bytes_sum[2h]) / rate(prometheus_tsdb_compaction_chunk_samples_sum[2h])
Which means that we'll need 30272644028.76188
(~28GB) bytes of storage.