简体   繁体   中英

How can i get save metric per second on prometheus?

For k8s v1.8 and Prometheus v2.2.1

I want to know number of metrics per second stored by Prometheus

How do I extract that information?

Prometheus exposes the metric prometheus_tsdb_head_samples_appended_total in the /metrics path of your prometheus instance. This counter represents the Total number of appended samples .

You can then use if for computing the rate of ingestion:

rate(prometheus_tsdb_head_samples_appended_total[1m])

Which is effectively the number of metrics per second stored by Prometheus as taken from the last minute.

If you want to sample the instantaneous number of metrics per second, you can also use irate() instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM