Use this file to discover all available pages before exploring further.
Before you create an Opsgenie notifier, generate an API key. Refer to the
Opsgenie documentation for
instructions.You can use variables
in your notifiers.
Web
Chronoctl
Terraform
API
To create an Opsgenie notifier:
In the navigation menu select
Alerts > Notifiers.
Click Create notifier.
Enter a descriptive name for the notifier.
Select Opsgenie as the type of notifier you want to create.
In the API Key field, enter the value of your Opsgenie API key.
In the API URL field, enter the following URL, which is called as a POST
request:
https://api.opsgenie.com/
Optional: Select Notify when resolved to send a resolved alert notification.
Click Save.
To create one or more notifiers using Chronoctl, create a YAML file
that defines them and apply the configuration to your instance.
You can use the notifiers scaffold command to generate an example notifier, and
then copy the resource definition for your notifier type:
chronoctl notifiers scaffold
Define the resource definition for your Opsgenie notifier:
Replace FILE_NAME with the name of your notifier YAML file.
To create an Opsgenie notifier:
Create a Opsgenie notifier with Terraform by using the
chronosphere_opsgenie_alert_notifier type followed by a name in a resource
declaration:
resource "chronosphere_opsgenie_alert_notifier" "opsgenie_notifier" { name = "Opsgenie Notifier" # Optional slug of the Opsgenie notifier. slug = "opsgenie-notifier" ## Notifier-specific required configuration # Detailed definitions can be found at: https://prometheus.io/docs/alerting/latest/configuration/#opsgenie_config api_key = "your-api-key" ## Notifier-specific optional configurations api_url = "your-api-url" message = "custom message" description = "description" source = "source" tags = ["tag-1", "tag-2"] note = "note" priority = "P1" details = { "first_detail" = "interesting detail" } # Can have multiple responders. responder { # Set one of the [id, name, username] fields name = "Productivity Platform - Compute" type = "TEAM" # Or: USER, ESCALATION, SCHEDULE } ## (Optional) Base configuration common to all notifiers send_resolved = true # The default value ## (Optional) HTTP configuration common to HTTP notifiers basic_auth_username = "username" basic_auth_password = "strong+p@ssword" # Can use bearer_token instead of basic auth proxy_url = "https://my-proxy-url" tls_insecure_skip_verify = false}
Enter your Opsgenie API key in the api_key field.
Enter the following URL in the api_url field:
https://api.opsgenie.com/
Run terraform apply to create the notifier resource:
terraform apply
To complete this action with the Chronosphere API, use the ops_genie object in the
CreateNotifier endpoint.Because the Chronosphere API requires authentication, include an API token with your
curl request, as shown in the following example. For more details, see
Create an API token.