alertmanager
alertmanager copied to clipboard
Missing a way to use time.Since and pretty format duration in templates
I want to be able to use a custom template to display the time the alert started to fire and how much time is it firing for, something like:
⌛ Firing since: 2024-02-12 18:15:38.457 +0000 UTC (for 3 hours 42 minutes 21 seconds).
We already have .StartsAt field for alert, but there's no template helper to 1) use time.Since(), and 2) pretty-format duration, so it would be lovely to have it here as well.
(I can and likely will add it by myself, if there's no objection)
No objection from me - this seems sensible.
@gotjosh okay I made a PR, can you look into that or ask somebody to review it? (not sure what's the workflow here)