英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论