Given a time series, is it possible to find the timestamp of the last value change?
For example, a cron job runs every night. It first runs an rsync job, and later computes the size of the target directory. The actual metric value is not all that significant, but I would like to verify that it actually changes every night.
Is it possible to create a query that return a scalar value with the timestamp of the last value change?
To get the last updated record in SQL Server: We can write trigger (which automatically fires) i.e. whenever there is a change (update) that occurs on a row, the “lastupdatedby” column value should get updated by the current timestamp.
The basic syntax of “timestamp” data type in SQL is as follows : Timestamp 'date_expression time_expression'; A valid timestamp data expression consists of a date and a time, followed by an optional BC or AD.
The standard way to handle this is to push a metric whose value is the unix timestamp that the batch jobs succeeded at. You can then alert on that value being recent enough.
https://www.robustperception.io/monitoring-batch-jobs-in-python/ has a Python example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With