Calculate Prometheus TSDB block size based on series count and sample density.
TSDB size scales with total sample count: samples = active_series × (86400 / scrape_interval) × retention_days, and raw size = samples × bytes_per_sample. Prometheus's TSDB uses delta-of-delta timestamp encoding and XOR-based value encoding within compacted blocks, meaningfully shrinking storage versus a naive per-sample byte cost — this calculator models that as a compaction ratio applied to the raw estimate.
tsdb_size_GB = active_series × bytes_per_sample × samples_per_day × retention_days / (1024^3)
Prometheus's own documentation cites roughly 1-2 bytes per sample after compaction for typical workloads, though this varies with label cardinality, value entropy (how much values actually change between scrapes), and time range.
Before compaction, each sample conceptually carries an 8-byte timestamp, an 8-byte float64 value, plus label reference overhead — 16 bytes/sample is a reasonable uncompressed baseline before TSDB's delta/XOR encoding kicks in.
Yes — very high-cardinality series (especially ones with volatile label sets) compact less efficiently because there's more unique label metadata to store and less opportunity for XOR encoding to find small deltas between consecutive samples.
Check the size of Prometheus's `data/` directory, or query `prometheus_tsdb_storage_blocks_bytes` for the current on-disk block size directly from Prometheus's own metrics.