简体   繁体   English

如何在普罗米修斯上获得每秒保存指标?

[英]How can i get save metric per second on prometheus?

For k8s v1.8 and Prometheus v2.2.1对于k8s v1.8Prometheus v2.2.1

I want to know number of metrics per second stored by Prometheus我想知道 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. Prometheus 在 prometheus 实例的/metrics路径中公开度量prometheus_tsdb_head_samples_appended_total This counter represents the Total number of appended samples .此计数器表示Total number of appended samplesTotal number of appended samples

You can then use if for computing the rate of ingestion:然后您可以使用 if 来计算摄取率:

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.这实际上是 Prometheus 从最后一分钟获取的每秒存储的指标数量。

If you want to sample the instantaneous number of metrics per second, you can also use irate() instead.如果要对每秒指标的瞬时数量进行采样,也可以改用irate()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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