That did the trick, thanks a lot!
On Wednesday, July 27, 2022 at 2:43:57 PM UTC+3 [email protected] wrote:
> 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/743d7fc0-9dfe-440f-ae4f-85b067183063n%40googlegroups.com.