Skip to content
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

More alert customization #130

Closed
derekoharrow opened this issue Jul 7, 2021 · 3 comments
Closed

More alert customization #130

derekoharrow opened this issue Jul 7, 2021 · 3 comments
Labels
area/alerting Related to alerting

Comments

@derekoharrow
Copy link

I'm using custom alerts to have Gatus alert via Pushover.

However, I'd really like the ability to have different alert configurations for pushover (i.e. multiple custom alerts).

The reason for this is that to get Pushover working, I have to embed the Pushover API parameters in the custom alert body, and I'd really like to be able to have more than one config for pushover - e.g. normal priority and high priority. I can't do this as I can only have one custom alert definition, and you cannot override the custom alert body text from within the service definition.

To get around this you could either:

  1. Enable multiple custom alerts (or multiple alert definitions of any type for that matter) - giving them a name (e.g. custom1, slack2, etc) and then defining the alert characteristics.
alerting:
  custom:
    name: custom1                     <<<<<<<<<<<<
    url: "https://hooks.slack.com/services/**********/**********/**********"
    method: "POST"
    insecure: true
    body: |
      {
        "text": "[ALERT_TRIGGERED_OR_RESOLVED]: [SERVICE_NAME] - [ALERT_DESCRIPTION]"
      }
services:
  - name: twinnation
    url: "https://twinnation.org/health"
    interval: 30s
    alerts:
      - type: custom1                     <<<<<<<<<<<<
        enabled: true
        failure-threshold: 10
        success-threshold: 3
        send-on-resolved: true
        description: "healthcheck failed"
  1. Enable all fields of the alert to be overridden within the service definition - e.g. being able to override the body text, etc.
    alerting, e.g.
  custom:
    url: "https://hooks.slack.com/services/**********/**********/**********"
    method: "POST"
    insecure: true
    body: |
      {
        "text": "[ALERT_TRIGGERED_OR_RESOLVED]: [SERVICE_NAME] - [ALERT_DESCRIPTION]"
      }
services:
  - name: twinnation
    url: "https://twinnation.org/health"
    interval: 30s
    alerts:
      - type: custom
        enabled: true
        body: { ALTERNATE BODY TEXT HERE }                     <<<<<<<<<<<<
        failure-threshold: 10
        description: "healthcheck failed"
@TwiN
Copy link
Owner

TwiN commented Jul 7, 2021

Hello @derekoharrow,

I'm aware that some users would like the ability to have several different provider configuration for the same providers, unfortunately, that would likely lead to a breaking change, and thus means that I'm not planning on working on it before Gatus v3.0.0 is around the corner.

There's another issue opened that could also benefit from your suggestion: #96
Since this issue is also kind of a duplicate of the one I linked above, I'll close this one.

That being said, I may work on #129, which should then allow you to use the custom provider for something else.


P.S. I try to prioritize issues based on number of 👍, so you may want to add a reaction in #96

@TwiN TwiN closed this as completed Jul 7, 2021
@TwiN TwiN added the area/alerting Related to alerting label Jul 30, 2021
@12nick12
Copy link

Would it be possible to hardcode many of the same like custom-1 custom-2 pagerduty-1 pagerdut-2 and maybe do 3 of each that way we at least have more than one?

@TwiN
Copy link
Owner

TwiN commented Mar 20, 2022

@12nick12 See #96

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

3 participants