Checking on date and return labels

76 views
Skip to first unread message

Myocptest User

unread,
May 7, 2021, 7:29:55 AM5/7/21
to Prometheus Users
Hi,

I'm trying to setup an alertmessage if the date of the last Velero backup (velero_backup_last_successful_timestamp{schedule="daily"}) is not of today.
I've tried that with the setup below, but it seems the comparison doesn't work in the expression. I want however to have the labels returned. 

annotations:
        description: There's no completed backup today for the backupschedule '{{ $labels.schedule }}'.
        message: The last successfull backup '{{ $labels.schedule }}' is {{ $value | humanizeDuration }} old.
        summary: No backup for today
        expr: time() - velero_backup_last_successful_timestamp{schedule="daily"} > hour() * 3600 + time() * 60

Any suggestions how to set this up?

Kind regards,  Ronald
Reply all
Reply to author
Forward
0 new messages