-
Notifications
You must be signed in to change notification settings - Fork 798
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
feature: basic support for incident.io in Argo Workflows #2245
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1b7df15
wip: add incident.io alert template
saikonen 8ffae86
add config options
saikonen 88efae9
add incident io success/failure templates with UI urls in summary
saikonen e462e52
fix error messages and lift severity-id to CLI instead of env vars
saikonen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
KUBERNETES_NAMESPACE, | ||
SERVICE_VERSION_CHECK, | ||
UI_URL, | ||
INCIDENT_IO_API_KEY, | ||
) | ||
from metaflow.package import MetaflowPackage | ||
|
||
|
@@ -176,6 +177,11 @@ def argo_workflows(obj, name=None): | |
default="", | ||
help="PagerDuty Events API V2 Integration key for workflow success/failure notifications.", | ||
) | ||
@click.option( | ||
"--notify-incident-io-api-key", | ||
default=INCIDENT_IO_API_KEY, | ||
help="Incident.io API V2 key for workflow success/failure notifications.", | ||
) | ||
@click.option( | ||
"--enable-heartbeat-daemon/--no-enable-heartbeat-daemon", | ||
default=False, | ||
|
@@ -213,6 +219,7 @@ def create( | |
notify_on_success=False, | ||
notify_slack_webhook_url=None, | ||
notify_pager_duty_integration_key=None, | ||
notify_incident_io_api_key=None, | ||
enable_heartbeat_daemon=True, | ||
deployer_attribute_file=None, | ||
enable_error_msg_capture=False, | ||
|
@@ -268,6 +275,7 @@ def create( | |
notify_on_success, | ||
notify_slack_webhook_url, | ||
notify_pager_duty_integration_key, | ||
notify_incident_io_api_key, | ||
enable_heartbeat_daemon, | ||
enable_error_msg_capture, | ||
) | ||
|
@@ -442,6 +450,7 @@ def make_flow( | |
notify_on_success, | ||
notify_slack_webhook_url, | ||
notify_pager_duty_integration_key, | ||
notify_incident_io_api_key, | ||
enable_heartbeat_daemon, | ||
enable_error_msg_capture, | ||
): | ||
|
@@ -453,11 +462,13 @@ def make_flow( | |
) | ||
|
||
if (notify_on_error or notify_on_success) and not ( | ||
notify_slack_webhook_url or notify_pager_duty_integration_key | ||
notify_slack_webhook_url | ||
or notify_pager_duty_integration_key | ||
or notify_incident_io_api_key | ||
): | ||
raise MetaflowException( | ||
"Notifications require specifying an incoming Slack webhook url via --notify-slack-webhook-url or " | ||
"PagerDuty events v2 integration key via --notify-pager-duty-integration-key.\n If you would like to set up " | ||
"Notifications require specifying an incoming Slack webhook url via --notify-slack-webhook-url, " | ||
"PagerDuty events v2 integration key via --notify-pager-duty-integration-key or Incident.io integration API key via --notify-incident-io-api-key.\n If you would like to set up " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit - line length |
||
"notifications for your Slack workspace, follow the instructions at " | ||
"https://api.slack.com/messaging/webhooks to generate a webhook url.\n For notifications through PagerDuty, " | ||
"generate an integration key by following the instructions at " | ||
|
@@ -507,6 +518,7 @@ def make_flow( | |
notify_on_success=notify_on_success, | ||
notify_slack_webhook_url=notify_slack_webhook_url, | ||
notify_pager_duty_integration_key=notify_pager_duty_integration_key, | ||
notify_incident_io_api_key=notify_incident_io_api_key, | ||
enable_heartbeat_daemon=enable_heartbeat_daemon, | ||
enable_error_msg_capture=enable_error_msg_capture, | ||
) | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont provide any of these as config options today for slack - can we lift them to cli args?