Atlassian Opsgenie OpsgenieAlert

Atlassian Opsgenie OpsgenieAlert

Certified

Post a custom alert to Opsgenie

Sends a raw alert payload to Opsgenie using the Alert API. Use in errors sections for flow failure notifications; pair with GenieKey auth and the url from Opsgenie alert requests.

yaml
type: io.kestra.plugin.opsgenie.OpsgenieAlert

Send a failed flow alert to Opsgenie.

yaml
id: unreliable_flow
namespace: company.team

tasks:
  - id: fail
    type: io.kestra.plugin.scripts.shell.Commands
    runner: PROCESS
    commands:
      - exit 1

errors:
  - id: alert_on_failure
    type: io.kestra.plugin.opsgenie.OpsgenieAlert
    url: "{{ secret('OPSGENIE_REQUEST') }}" # https://api.opsgenie.com/v2/alerts/requests/xxx000xxxxx
    payload: |
      {
        "message":"Kestra Opsgenie alert",
        "alias":"ExecutionError",
        "responders":[
            {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
            {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"},
            {"id":"aee8a0de-c80f-4515-a232-501c0bc9d715","type":"escalation"},
            {"id":"80564037-1984-4f38-b98e-8a1f662df552","type":"schedule"}
         ],
        "visibleTo":[
            {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
            {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"}
         ],
        "tags":["ExecutionFail","Error","Execution"],
        "priority":"P1"
      }
    authorizationToken: "{{ secret('OPSGENIE_GENIEKEY') }}"

Send a Opsgenie alert.

yaml
id: opsgenie_incoming_webhook
namespace: company.team

tasks:
  - id: send_opsgenie_message
    type: io.kestra.plugin.opsgenie.OpsgenieAlert
    url: "{{ secret('OPSGENIE_REQUEST') }}"
    payload: |
      {
        "message":"Kestra Opsgenie alert",
        "alias":"Some Execution",
        "responders":[
            {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
            {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"}
         ],
        "visibleTo":[
            {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
            {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"}
         ],
        "tags":["Execution"],
        "priority":"P2"
      }
    authorizationToken: "{{ secret('OPSGENIE_GENIEKEY') }}"
    options:
      headers:
        X-Custom-Source: kestra-flow
      connectTimeout: PT5S
Properties
Min length1

Alert request URL

Full Opsgenie alert endpoint (for example https://api.opsgenie.com/v2/alerts/requests/{token}); typically stored as a secret.

GenieKey authorization token

Opsgenie GenieKey sent as Authorization header; prefer {{ secret(...) }}.

Tune Opsgenie HTTP client

Optional HTTP client settings for Opsgenie calls. Connect timeout, read idle timeout, default charset, and headers are applied; other fields are currently ignored by the client builder.

Definitions
connectTimeoutstring

Connect timeout

Maximum time to open the connection before failing; uses the HTTP client default when unset.

connectionPoolIdleTimeoutstring
DefaultPT0S

Connection pool idle timeout

Idle lifetime for pooled connections before close; currently not applied by the client builder.

defaultCharsetstring
DefaultUTF-8

Default request charset

Charset used for request bodies; defaults to UTF-8.

headersobject

HTTP headers

Additional headers rendered and added to each request.

maxContentLengthintegerstring
Default10485760

Max content length

Maximum response size in bytes; currently not applied by the client builder.

readIdleTimeoutstring
DefaultPT5M

Read idle timeout

Closes idle read connections after inactivity; defaults to PT5M.

readTimeoutstring
DefaultPT10S

Read timeout

Maximum time allowed for reading the response body; kept for compatibility, not applied to the current client builder.

Alert payload

JSON body sent to Opsgenie; render expressions before sending. Must follow the Opsgenie Alert API schema.

Reference (ref) of the pluginDefaults to apply to this task.