Aside: if your metrics are only updated every 5 minutes from a batch job,
then node_exporter's textfile collector is the simplest way to do this.
The recommended way to expose the time when a metric was updated is to have
a separate metric with the timestamp. The textfile collector does this
automatically:
$ curl -Ss localhost:9100/metrics | grep node_textfile
# HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully
read.
# TYPE node_textfile_mtime_seconds gauge
*node_textfile_mtime_seconds{file="role.prom"} 1.505382562e+09*
# HELP node_textfile_scrape_error 1 if there was an error opening or
reading a file, 0 otherwise
# TYPE node_textfile_scrape_error gauge
node_textfile_scrape_error 0
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/1dc56af0-e3f2-45c5-8ef7-dde3ad88dc51%40googlegroups.com.