Atlassian Opsgenie OpsgenieExecution

Atlassian Opsgenie OpsgenieExecution

Certified

Send execution alert via Opsgenie

Builds an Opsgenie alert from the current execution using opsgenie-template.peb, including link, IDs, namespace, duration, status, and failed task when applicable. Use inside flows triggered by Flow triggers; for errors sections use OpsgenieAlert instead.

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

Send notification on a failed flow execution via Opsgenie.

yaml
id: failure_alert
namespace: company.team

tasks:
  - id: send_alert
    type: io.kestra.plugin.opsgenie.OpsgenieExecution
    url: "{{ secret('OPSGENIE_REQUEST') }}" # format: 'https://api.opsgenie.com/v2/alerts/requests/xxxxxxyx-yyyx-xyxx-yyxx-yyxyyyyyxxxx'
    message: "Kestra Opsgenie alert"
    alias: ExecutionError
    responders:
      4513b7ea-3b91-438f-b7e4-e3e54af9147c: team
      bb4d9938-c3c2-455d-aaab-727aa701c0d8: user
      aee8a0de-c80f-4515-a232-501c0bc9d715: escalation
      80564037-1984-4f38-b98e-8a1f662df552: schedule
    visibleTo:
      4513b7ea-3b91-438f-b7e4-e3e54af9147c: team
      bb4d9938-c3c2-455d-aaab-727aa701c0d8: user
    priority: P1
    tags:
      - ExecutionError
      - Error
      - Fail
      - Execution
    authorizationToken: "{{ secret('OPSGENIE_GENIEKEY') }}"
    options:
      headers:
        X-Flow-Env: prod
      connectTimeout: PT5S

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: prod
        prefix: true
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.

Alert alias

Optional alias override for the alert payload.

GenieKey authorization token

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

Custom fields to be added on notification

Custom message to be added on notification

Default{{ execution.id }}

The execution id to use

Default is the current execution, change it to {{ trigger.executionId }} if you use this task with a Flow trigger to use the original execution.

Alert message

Overrides message in the rendered template; supports expressions.

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.

Alert priority

Priority code such as P1P5; overrides the template value if present.

Responders map

Map of responder id to type (team, user, escalation, schedule); converted to the Opsgenie responders list.

SubTypestring

Alert tags

List of tags added to the alert payload.

Template variables

Key/value map rendered into the Pebble template before building the alert payload.

Visible-to map

Map of entity id to type granting visibility (team or user); converted to the Opsgenie visibleTo list.