Skip to content

Support setting body alert at the endpoint level #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pablomendezroyo opened this issue Mar 7, 2025 · 0 comments
Open

Support setting body alert at the endpoint level #1021

pablomendezroyo opened this issue Mar 7, 2025 · 0 comments
Labels
area/alerting Related to alerting

Comments

@pablomendezroyo
Copy link

pablomendezroyo commented Mar 7, 2025

Describe the feature request

Right now, seems like its only supported defining the body of the alert under alerting and not under the endpoint level. e.g:

alerting:
  custom:
    url: "https://hooks.slack.com/services/**********/**********/**********"
    method: "POST"
    body: |
      {
        "text": "[ALERT_TRIGGERED_OR_RESOLVED]: [ENDPOINT_GROUP] - [ENDPOINT_NAME] - [ALERT_DESCRIPTION] - [RESULT_ERRORS]"
      }
endpoints:
  - name: website
    url: "https://twin.sh/health"
    interval: 30s
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300"
    alerts:
      - type: custom
        failure-threshold: 10
        success-threshold: 3
        send-on-resolved: true
        description: "health check failed"

It would be great to support this at the endpoint level to allow more flexibility in custom alerting. It could be allowed to write the body in the endpoint level overwriting the body from the alerting level if defined. e.g

alerting:
  custom:
    url: "https://hooks.slack.com/services/**********/**********/**********"
    method: "POST"
    body: |
      {
        "text": "[ALERT_TRIGGERED_OR_RESOLVED]: [ENDPOINT_GROUP] - [ENDPOINT_NAME] - [ALERT_DESCRIPTION] - [RESULT_ERRORS]"
      }
endpoints:
  - name: website
    url: "https://twin.sh/health"
    interval: 30s
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300"
    alerts:
      - type: custom
        failure-threshold: 10
        success-threshold: 3
        send-on-resolved: true
        description: "health check failed"
      body: |
        {
          "text": "this is a custom body"
        }

Why do you personally want this feature to be implemented?

To have more flexibility in the custom alerting

How long have you been using this project?

1 week

Additional information

It would be cool to extend this feature to placeholders

    placeholders:
      ALERT_TRIGGERED_OR_RESOLVED:
        TRIGGERED: "partial_outage"
        RESOLVED: "operational"

Extending this to be configurable at the endpoint level

@github-actions github-actions bot added the area/alerting Related to alerting label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Related to alerting
Projects
None yet
Development

No branches or pull requests

1 participant