Overview of steps
- Set up Api Integration for Opsgenie
- Update Mage project settings
Configure alerts in the Mage Pro UI
After you create your Opsgenie API integration, you can configure alerts in the Mage Pro UI instead of editingmetadata.yaml directly:
- For project defaults, go to Settings > Account > Alerts.
- For one pipeline, open the pipeline and go to Alerts. Pipeline-level settings override the project-level alert config for that pipeline.
- Choose the alert outcomes, enable Opsgenie, enter the API URL and API key, and use Send test notification to send a test alert before saving.
{{ env_var('MAGE_OPSGENIE_API_KEY') }}.
Set up Api Integration for Opsgenie
Follow these instructions on Opsgenie to setup an API Integration in your account.Update Mage project settings
Once you’ve set up API Integration for Opsgenie, you should have an API Key that Opsgenie provides. Follow these steps to add that Opsgenie Configuration to your project settings:- Open the Mage tool in your browser (e.g. http://localhost:6789/).
- Open a pipeline and start editing it (e.g. http://localhost:6789/pipelines/example_pipeline/edit).
-
In your left sidebar in the file browser, scroll all the way down and click
on a file named
metadata.yaml. -
In the
metadata.yamlfile, add a section with the following configuration or update the existingnotification_configsection:If you omit thealert_onsection it will default totrigger_failureandtrigger_passed_sla. Options:trigger_failure: alert when a run of a trigger failstrigger_success: alert when a run of a trigger succeedstrigger_passed_sla: alert when a run of a trigger passes sla
-
In the
metadata.yamlfile, add the following values:Change theyour_api_keyvalue to be the API Key you created from Opsgenie.
