Locatinme in Alertmanager

69 views
Skip to first unread message

Tareerat Pansuntia

unread,
May 9, 2024, 4:06:03 AM5/9/24
to Prometheus Users
Hello! all.  I set up a website monitoring project using Prometheus, Blackbox Exporter, and Alertmanager to monitor and send notifications. I have configured it to send alerts via Line Notify using a webhook receiver. However, i currently facing an issue with setting the timezone to my country's timezone. this is my config

global:
 resolve_timeout: 1m

route:
  group_by: ['alertname']
  group_wait: 30s
  group_interval: 10s
  repeat_interval: 10s
  receiver: 'email and line-notify'

receivers:
- name: 'email and line-notify'
  email_configs:
  - to: '...
  webhook_configs:
    - ...

time_intervals:
- name: everyday
  time_intervals:
  - times:
    - start_time: "00:00"
      end_time: "23:59"
    location: 'Asia/Bangkok'

inhibit_rules:
  - source_match:
      severity: 'critical'
    target_match:
      severity: 'warning'
    equal: ['alertname', 'instance']

Could someone please guide me on the correct format for specifying time intervals in Prometheus?

Regards.
Tareerat

Brian Candler

unread,
May 9, 2024, 6:23:10 AM5/9/24
to Prometheus Users
Can you describe what the actual problem is? Are you seeing an error message, if so what is it?

Why are you defining a time interval of 00:00 to 23:59, which is basically all the time apart from 1 minute between 23:59 and 24:00? You also don't seem to be referencing it from a routing rule.

In any case, "Time interval" only affects what times notifications are sent or muted, and only if you refer to them in a routing rule. It makes no change to the *content* of the notification.

If you want the notifications to contain local times, then you'll need to show the configuration of your receivers - are you doing template expansion? Which exact parts of the message do you want to change? Of course, your webhook receiver can do whatever reformatting of the messages you like.
Reply all
Reply to author
Forward
0 new messages