简体   繁体   中英

Prometheus exporter with historical data

Is it possible for a Prometheus exporter to save historical data and not only devliver the value while scraping?

My goal is that my exporter is reading a value (let's say a sensor) every 1ms and saving it. Every 15 seconds now Prometheus pulls the data and gets the list of values since last scraping.

Is this possible/intenden to be done with an exporter?
Because if i get it correctly the exporter is not intended to save values, only to read a value when Prometheus scrapes it.
Scheduling of scraping

If it is not possible to solve this with an exporter i only see the solution to add a timeseries database between the node and the exporter. And the exporter then only pulls the data from the tsdb.
|Node| --[produces value each ms] --> |InfluxDB| --> |Exporter| --> |Prometheus|

Do i miss something here?

There are the following options:

  • To push data directly to Prometheus-compatible remote storage such as VictoriaMetrics , so the data could be queried later with PromQL from Grafana.
  • To scrape data from the exporter with vmagent with short scrape interval, so it could push the scraped data to remote storage when it is available.
  • To collect the data at exporter side in Histograms , so they are scraped later by Prometheus, vmagent or VictoriaMetrics. This approach may lead to the lowest amounts of storage space requred for metrics and the highest query speed.

You can use prometheus pushgateway for that. You can push your metrics as frequent as you want, pushgateway will expose these metrics for prometheus

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