Opsgenie team responders support #43281
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when creating an Opsgenie alert with the Opsgenie integration, responders can only be of type
schedule
.However that are situations where type
teams
are required to work with Opsgenie integrations, as well, teams takes multiple schedules into consideration, such as escalations schedules.Instead of changing the
teleport.dev/notify-services
annotation to support teams by default, I purpose adding a new annotationteleport.dev/teams
that will contains the respective teams and the result will be a merge of both annotations to the responders payload.Teleport role:
will be converted into Opsgenie payload
Update
While adding the test in the suite, I found a couple of issues:
Since the alias is the same for all alerts, Opsgenie does not consider unique alerts, so it add a count instead of creating duplicate alerts (message below is from an alert activity log). Thats why I also think this was not caught by the tests.
However since the alert request already contains all the schedule in the responders fields, there is no need to create multiple alerts.
ID
, but since we are actually using the name on the annotations, the alert is created with no responders, due to the ID (which is the name) did not exist. Updating toName
instead, fixes the issue.