I send alerts from prometheus to rocketchat webhook. This is the configuration of one of my alert rule:
- alert: HighCpuLoad
expr: 100 - (avg by (instance, group, host) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 81
for: 5m
labels:
severity: warning
annotations:
timestamp: "{{ with query "time()" }}{{ . | first | value | humanizeTimestamp }}{{ end }}"
description: "Check CPU load on host {{ $labels.host }}"
firing_text: "CPU load on host {{ $labels.host }} is > 80%\n VALUE = {{ humanize $value }}"
resolved_text: "High CPU load on host {{ $labels.host }} is resolved"
All parameters that I have defined in annotation (timestamp, description, firing_text and resolved_text) are sent to alertmanager. But I don't receive the "timestamp" in rocketchat alert.
This is the alert in alertmanager UI: enter image description here
This is the alert message that is appear in rocketchat webhook: enter image description here
As you can see the timestamp is not shown in alert message.
How can I make it appear in webhook alert messages?
By the way, I want to send the date and time of the point when the criteria meet. for example in my expression if my cpu load become above 80 percent at 2020-12-24 08:00:00 It wait for 5 minutes and then send the alert and if the alertmanager queue has other alerts to send, it will take some other minutes to send the alert to rocketchat webhook (more than 5 minutes). I need to send exact the point when the issue ocuures (in this example 2020-12-24 08:00:00 not 2020-12-24 08:05:00 or maybe 08:06:00).