Skip to content

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

@freak12techno

Description

@freak12techno

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions