I am trying to get alerts with a local timezone as a timestamp and i don't 
seem to be getting ti right all notifications go out as UTC.. I want to set 
this in two places in annotations and in my template. But these are just 
ignored by prometheus. I found this link:

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/PrometheusAlertTimeFormatting

But the link does not explain where do you need to set this exactly. 

The way i set it in my email template is like this in the alertmanager.yml 
file:

*text*: >-

        {{ range .Alerts -}}

        **Time*: {{ .StartsAt.Local.Format "Sat Aug 14 10:15:40 SAST 2021" 
}} {{ end }}

        **Alert*:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ 
.Labels.severity }}`{{ end }}

        **Description*:* {{ .Annotations.description }}

        **Details*:*

          {{ range .Labels.SortedPairs }}: *{{ .Name }}:* `{{ .Value }}`

          {{ end }}

        {{ end }}
I tried annotations in the alerts file as well but these are just flat out 
ignored.

 *annotations*:

      *timestamp*: >

         *time*:  {{ range .Alerts.Firing }}

                      {{ .StartsAt.Local.Format "Sat Aug 14 10:15:40 SAST 
2021" }}

                {{ end }}

What am i doing wrong? Has anyone gotten it to work? I am using 
alertmanager 0.21.0 and Prometheus 2.24.1




-- 
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/4cd44c41-4b26-4033-bf2c-a6e35b670cecn%40googlegroups.com.

Reply via email to