0

I tried to add this to my alertmanager.yml in root level, but I got this error: yaml: unmarshall errors: field time_intervals not found in type config.plain

time_intervals:
  - times:
    weekdays: ['monday:friday']

(I used 0.23 version of Alertmanager)

TestAutomator
  • 289
  • 1
  • 3
  • 14

1 Answers1

3

The correct syntax is the following:

time_intervals:
  - name: monday-to-friday
    time_intervals:
      - weekdays: ['monday:friday']

You can use this time interval like shown in the following example:

route:
  group_by: ...
  ...
  routes:
    - receiver: SOME-RECEIVER
      matchers:
        - SOME-MATCHER
      active_time_intervals:
        - monday-to-friday
    ...
  • Could you please ellaborate more on this? I'm facing with difficulties to apply this in my configuration. So I have one reciever, not recievers and I don't have matcher. It confuses me a bit. I have something like: `global: ... route: group_by: ... ... reciever: 'email' ... recievers: - name: 'email' ... time_intervals: - name: monday-to-friday time_intervals: - weekdays: ['monday:friday'] ` – TestAutomator Jun 09 '22 at 18:33
  • Sorry I could not format my comment with line breaks. :\ – TestAutomator Jun 09 '22 at 18:39
  • Edit your question to add this information. – Marcelo Ávila de Oliveira Jun 09 '22 at 20:36
  • Instead of adding an image in the Google drive in a comment, EDIT your question and add the information there. I just added more info to the answer. There's a "routes:" clause missing in your configuration and you need to add a "matches:" clause to instruct Alertmanager in which situation that receiver will receive the alert. – Marcelo Ávila de Oliveira Jun 10 '22 at 02:32