Prometheus itself doesn't provide built-in tools to directly analyze which metrics are using the most storage. However, there are several ways you can get an idea of which metrics are taking up a lot of space:
-
Cardinality: A single Prometheus metric with high cardinality (a large number of unique timeseries) can take up a lot of storage. You can use PromQL queries to find metrics with high cardinality. One such query might be
count({__name__=~".+"}) by (__name__)
, which will count the number of unique timeseries for each metric. -
Metric volume: You can also check the rate at which metrics are ingested into Prometheus, using a query like
rate(prometheus_tsdb_head_samples_appended_total[5m])
. This will give you an idea of how many samples are being ingested, which could be a good proxy for understanding which metrics are taking up a lot of space. However, this query won't directly tell you which metrics are responsible for the volume, but will tell you how quickly you're accumulating data ove