Are there any existing programs for scraping Prometheus-formatted metrics and sending them to StatsD?

老子叫甜甜 提交于 2019-12-08 06:35:38

问题


I have an application that exposes metrics in the Prometheus format at an HTTP endpoint but want to run it in an environment that uses StatsD. Prometheus provides a program that accepts StatsD metrics and exports them to Prometheus, but I can't seem to find a program to do the reverse. I understand that all metric types might not map cleanly, but are there any such programs out there or libraries that do some of the work for you?


回答1:


I'm not aware of any such tool, however several Prometheus clients have a parser for the Prometheus text format such as Python and that could be then munged and sent on to statsd.




回答2:


StatsD is a tool for aggregating events into metrics / time series. The data on Prometheus /metrics endpoints is already in the form of metrics, so it has already been aggregated over time (e.g. a counter containing the count of many events). While you can go from events to metrics (which is what https://github.com/prometheus/statsd_exporter does), you can't go the other way around, since information is already lost. So I don't think it makes sense to send Prometheus metrics to a StatsD endpoint in general. You'd either have to instrument on an event basis (e.g. using a StatsD client library) in the first place, or you can just skip the StatsD step and instead scrape and write out the finished metrics into Graphite or whatever other TSDB your StatsD normally writes to.



来源:https://stackoverflow.com/questions/44706574/are-there-any-existing-programs-for-scraping-prometheus-formatted-metrics-and-se

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!