Prometheus Golang (echo-contrib) exporter是否将指标保存在内存中?

huangapple go评论66阅读模式
英文:

Does prometheus golang (echo-contrib) exporter saves metrics in memory?

问题

我有一个用于将指标导出到Prometheus的GoLang中间件,然后从/metrics端点提供这些指标。

我的问题是/metrics端点接收到的数据来自哪里?
它来自内存吗?

导出器链接:https://github.com/labstack/echo-contrib/tree/master/prometheus

英文:

I have a GoLang middleware for exporting metrics for prometheus, which are then served from /metrics endpoint

My question is where does the data received from /metrics endpoint come from?
Does it come from the memory?

Exporter link: https://github.com/labstack/echo-contrib/tree/master/prometheus

答案1

得分: 1

是的,指标的最后状态存储在被抓取目标的内存中。大多数使用Prometheus指标的实现是在Go程序中使用这个库构建的:https://github.com/prometheus/client_golang

被抓取的目标不会保存整个时间序列,而是由Prometheus负责跨时间存储这些值。

英文:

Yes, the last state of the metrics are stored in memory of the scraped target. Most of the implementation of prometheus metrics are built with this library in go programs: https://github.com/prometheus/client_golang

Your scraped target won't hold the whole time serie, it's prometheus role to store these values across time.

huangapple
  • 本文由 发表于 2022年6月27日 05:50:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/72765377.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定