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 teams #266

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

appleboy
Copy link
Contributor

Add group-specific webhook URL for teams alert

Provides support for paging multiple teams based on the group selector while keeping backward compatibility to the old Teams configuration manifest

integration per team can be specified in the overrides sections in an array form.

alerting:
  teams:
    webhook-url: "https://********.webhook.office.com/webhookb2/************"
    # 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://********.webhook.office.com/webhookb3/************"

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

ref: #96

Signed-off-by: Bo-Yi Wu [email protected]

@appleboy
Copy link
Contributor Author

@TwiN I also reset the table format in README.md.

@TwiN TwiN added feature New feature or request area/alerting Related to alerting labels Mar 23, 2022
@TwiN TwiN changed the title feat(alert): Add group-specific webhook URL for teams feat(alerting): Add group-specific webhook URL for teams Mar 23, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #266 (c7e7bb9) into master (0bf2271) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #266      +/-   ##
==========================================
+ Coverage   83.57%   83.64%   +0.06%     
==========================================
  Files          53       53              
  Lines        3434     3448      +14     
==========================================
+ Hits         2870     2884      +14     
  Misses        439      439              
  Partials      125      125              
Impacted Files Coverage Δ
alerting/provider/teams/teams.go 91.78% <100.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 0bf2271...c7e7bb9. Read the comment docs.

@appleboy
Copy link
Contributor Author

@TwiN Any feebacks?

@TwiN
Copy link
Owner

TwiN commented Mar 24, 2022

@appleboy Sorry for the delay; I've been very busy during the past few weeks and have had little time to spare.
I'll review it in a few minutes!

Copy link
Owner

@TwiN TwiN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Thank you for the contribution @appleboy!

@TwiN TwiN merged commit 5281f80 into TwiN:master Mar 24, 2022
@appleboy appleboy deleted the teams branch March 24, 2022 00:47
@appleboy
Copy link
Contributor Author

@TwiN Thanks. I will prepare the slides to promote this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Related to alerting feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants