Skip to content

Custom alerts within suites do not respect alerting.custom.default-alert settings #1392

@dotfiles-n-stuff

Description

@dotfiles-n-stuff

Describe the bug

Custom alerts defined for endpoints within suites do not respect alerting.custom.default-alert settings, namely failure-threshold: 1, and uses default value of 3. Also alerting.custom.default-alert.success-threshold: 1 and alerting.custom.default-alert.send-on-resolved: true have no effect at all and resolve alerts are not sent.

If failure-threshold and others are defined at suites.endpoints.alerts instead of alerting.custom.default-alert then everything works as expected and resolve alerts are sent also.

What do you see?

Alerts sent after 3 failures. Resolve alerts are not sent.

What do you expect to see?

Alerts sent after 1 failures. Resolve alerts are sent after 1 success.

List the steps that must be taken to reproduce this issue

#cat alerting.yml
alerting:
  custom:
    url: "https://some-url"
    method: "POST"
    headers:
      Authorization: "Bearer blah"
      Content-Type: "application/json"
    body: |
      {
        "group_chat_id": "blah", "notification": {"body": "[ALERT_TRIGGERED_OR_RESOLVED] [ENDPOINT_NAME]!    ->    [RESULT_CONDITIONS]"}
      }
    default-alert:
      send-on-resolved: true
      failure-threshold: 1
      success-threshold: 1
# head -n30 suites.yaml
suites:
  - name: some.host
    group: "some.host"
    interval: 1m
    endpoints:
      - name: some.host-icmp
        url: "icmp://some.host"
        conditions:
          - "[CONNECTED] == true"
      - name: some.host-http
        url: http://some.host
        conditions:
          - "[STATUS] == 200"
        alerts:
          - type: custom

Version

v5.31.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/alertingRelated to alertingbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions