KOP Recipes - Opsgenie - Rafay Product Documentation
Opsgenie
Although a turnkey integration is available for email based notifications, organizations may wish to send notifications to other platforms in use internally.
This recipe documents how organizations can customize the "Alert Manager" system addon configuration and send the alerts to Opsgenie by Atlassian
Configure Opsgenie
If you would like to setup the alerting through Opsgenie, you will need an existing Opsgenie account or sign up for a trial here
To setup the alerting to your Opsgenie, you will need to create a new Prometheus Integration under the service team
Login into Opsgenie > Teams and select the team name to create the integration
Add a new integration for the selected team
Search for "Prometheus" integration
Add the "Prometheus" integration to the team
Copy the "Prometheus" integration API Key to use in later steps
Save the "Prometheus" integration settings for the selected team
Configure Alert Manager
Follow the steps described below to create a customized Alert Manager configuration for use with Ops Genie.
Go to Infrastructure -> Addons
Create a new addon with using "Customize System Addon" option.
Create a new version for the custom system Alert Manager addon.
Download the default configuration manifest.
Add the custom receiver for Opsgenie to the "receivers" section of the configuration with "api_key" from the Integration Key from the configure Opsgenie step.
receivers:
- name: default-receiver
- name: rafay-webhook
webhook_configs:
- http_config:
tls_config:
ca_file: /etc/config/certs/ca.crt
cert_file: /etc/config/certs/client.crt
insecure_skip_verify: true
key_file: /etc/config/certs/client.key
server_name: '{{{ .V2EventFrameworkFQDN }}}'
url: https://{{{ .V2EventFrameworkFQDN }}}/event/v1/alert/raise
- name: myalerts
Opsgenie_configs:
- send_resolved: true
api_key: 6ffcxxxxxxxxxxxe155
- Next add the custom receiver for Opsgenie Alerts to the routes configuration in "route" section
route:
group_interval: 5m
group_wait: 10s
receiver: rafay-webhook
repeat_interval: 3h
routes:
- continue: true
match_re:
severity: .*
receiver: rafay-webhook
- match_re:
severity: .*
receiver: myalerts
Upload the modified configuration to the addon
Save the custom Alert Manager addon version
Update Cluster Blueprint
Follow the below steps to deploy the customized Alert Manager configuration for Opsgenie notifications to your clusters.
Go to Infrastructure > Blueprints
Add this custom Alert Manager addon to the custom blueprint for the cluster
Update the new blueprint version with the customized Alert Manager addon to the clusters
The new system Alert Manager addon will be deployed to the clusters
In a few minutes, the blueprint will be published successfully and the customized Alert Manager addon is deployed to the clusters
Verify Configuration
Once there are alerts generated in the clusters, you should see the notifications in your Opsgenie service integration activity. An illustrative example is shown below