Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing a way to use time.Since and pretty format duration in templates #3717

Closed
freak12techno opened this issue Feb 12, 2024 · 3 comments · Fixed by #3863
Closed

Missing a way to use time.Since and pretty format duration in templates #3717

freak12techno opened this issue Feb 12, 2024 · 3 comments · Fixed by #3863

Comments

@freak12techno
Copy link
Contributor

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.

@freak12techno
Copy link
Contributor Author

freak12techno commented Feb 12, 2024

(I can and likely will add it by myself, if there's no objection)

@gotjosh
Copy link
Member

gotjosh commented Feb 13, 2024

No objection from me - this seems sensible.

@freak12techno
Copy link
Contributor Author

@gotjosh okay I made a PR, can you look into that or ask somebody to review it? (not sure what's the workflow here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants