Hi,
It's not pretty but you can use: {{ .StartsAt.Unix }}000
There's various other alternatives in the comments on
https://github.com/prometheus/alertmanager/issues/1188
David
On Wed, 27 Jul 2022 at 20:43, 'Dudi Cohen' via Prometheus Users
<[email protected]> wrote:
>
> Hi,
>
> I want to include a link to a Grafana dashboard within a Prometheus alert
> rule.
> The time of the alert should be added as a query parameter in the dashboard
> URL so that the link leads you to the time when the alert was triggered.
>
> According to the Grafana docs the time query needs to be in epoch ms:
> https://grafana.com/docs/grafana/next/dashboards/manage-dashboard-links/#controlling-time-range-using-the-url
>
> Alertmanager has a `StartsAt` function which gives the current time:
> https://prometheus.io/docs/alerting/latest/notifications/#alert
>
> Is there a way to convert this time output to epoch ms so I can use it within
> the Grafana dashboard URL?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/af28e96b-255c-41af-b05a-624caa18a897n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/CAP9KPhAqfLVO8rJx790aUQWn0gxCtgyW0qo-f5n7cnDxwRPfLQ%40mail.gmail.com.