Skip to content

Conversation

@stendler
Copy link
Contributor

@stendler stendler commented Jun 3, 2024

Summary

This PR allows customizing headers with placeholder contents, e.g., based on ALERT_TRIGGERED_OR_RESOLVED.
Also, implemented ReplacePlaceholder to avoid repeating replace in body, url, and in a loop for the headers.

Example use case customizing ntfy:

alerting:
  custom:
    url: "https://ntfy.sh/mytopic"
    method: POST
    body: |
      Alert for [ENDPOINT_URL] with description:
      [ALERT_DESCRIPTION]
    headers:
      Firebase: "no"
      Title: "[ENDPOINT_GROUP] - [ENDPOINT_NAME]"
      Tags: "[ALERT_TRIGGERED_OR_RESOLVED]"
      Priority: 4
    placeholders:
      ALERT_TRIGGERED_OR_RESOLVED:
        TRIGGERED: "rotating_light"
        RESOLVED: "white_check_mark"
    default-alert:
      failure-threshold: 2
      success-threshold: 3
      send-on-resolved: true

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

@stendler stendler force-pushed the feat-custom-header-placeholders branch 2 times, most recently from 1561a84 to ecc1653 Compare October 2, 2025 12:35
@stendler
Copy link
Contributor Author

stendler commented Oct 2, 2025

@TwiN I totally missed, that this PR was blocked due to merge conflicts. I rebased and resolved them

@stendler stendler force-pushed the feat-custom-header-placeholders branch from ecc1653 to 887d829 Compare October 16, 2025 11:53
@stendler
Copy link
Contributor Author

stendler commented Oct 16, 2025

Rebased again to resolve conflicts introduced with 129fb82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant