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

feat(alerting): Add group-specific WebHook URL for Google Chat #272

Merged
merged 3 commits into from
May 7, 2022

Conversation

appleboy
Copy link
Contributor

Add group-specific webhook URL for Google Chat

alerting:
  googlechat: 
    webhook-url: "https://chat.googleapis.com/v1/spaces/*******/messages?key=**********&token=********"
    # You can also add group-specific to keys, which will 
    # override the to key above for the specified groups
    overrides:
      - group: "core"
        webhook-url: "https://chat.googleapis.com/v1/spaces/*******/messages?key=**********&token=********"

endpoints:
  - name: website
    url: "https://twin.sh/health"
    interval: 30s
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300"
    alerts:
      - type: googlechat
        enabled: true
        description: "healthcheck failed"
        send-on-resolved: true

  - name: back-end
    group: core
    url: "https://example.org/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[CERTIFICATE_EXPIRATION] > 48h"
    alerts:
      - type: googlechat
        enabled: true
        description: "healthcheck failed"
        send-on-resolved: true

ref: #96

Signed-off-by: Bo-Yi Wu appleboy.tw@gmail.com

Add group-specific webhook URL for Google Chat

ref: TwiN#96

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@TwiN
Copy link
Owner

TwiN commented Mar 28, 2022

Will wait for #271 before looking into this, since there seems to be some overlapping suggestions.

@TwiN
Copy link
Owner

TwiN commented Apr 17, 2022

Any chance you could look into applying the same changes I requested in #271? 🙏

@appleboy
Copy link
Contributor Author

appleboy commented May 4, 2022

@TwiN I will take it.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy
Copy link
Contributor Author

appleboy commented May 4, 2022

@TwiN Done. Please help to review again.

@codecov-commenter
Copy link

Codecov Report

Merging #272 (d16a5dd) into master (5281f80) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
- Coverage   83.70%   83.68%   -0.03%     
==========================================
  Files          53       53              
  Lines        3462     3499      +37     
==========================================
+ Hits         2898     2928      +30     
- Misses        439      444       +5     
- Partials      125      127       +2     
Impacted Files Coverage Δ
alerting/provider/googlechat/googlechat.go 94.11% <100.00%> (+0.93%) ⬆️
config/maintenance/maintenance.go 92.40% <0.00%> (-3.80%) ⬇️
config/ui/ui.go 63.88% <0.00%> (-2.78%) ⬇️
alerting/provider/discord/discord.go 91.78% <0.00%> (+1.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5281f80...d16a5dd. Read the comment docs.

@TwiN TwiN merged commit dde930b into TwiN:master May 7, 2022
@appleboy appleboy deleted the googlechat branch May 8, 2022 03:42
@TwiN
Copy link
Owner

TwiN commented Jun 21, 2022

Released in v4.0.0

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.

None yet

3 participants