What is the best method for exposing a timestamp from your application?
Export the Unix timestamp as the value of a gauge. Gauges can be set to a current state value, and Prometheus recommends exporting an event timestamp rather than a derived elapsed-time value; elapsed time can then be calculated with time() - my_timestamp_metric.
time() - my_timestamp_metric
Community Discussion