Send a Sentry alert when a specific flow or task fails.

Add this task to a list of errors tasks to implement custom flow-level failure notifications.

The only required input is a DSN string value, which you can find when you go to your Sentry project settings and go to the section Client Keys (DSN). You can find more detailed description of how to find your DSN in the following Sentry documentation.

You can customize the alert payload, which is a JSON object, or you can skip it and use the default payload created by Kestra. For more information about the payload, check the Sentry Event Payloads documentation.

The event_id is an optional payload attribute that you can use to override the default event ID. If you don't specify it (recommended), Kestra will generate a random UUID. You can use this attribute to group events together, but note that this must be a UUID type. For more information, check the Sentry documentation.

yaml
type: "io.kestra.plugin.notifications.sentry.SentryAlert"

Send a Sentry alert on a failed flow execution

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.notifications.sentry.SentryAlert
    dsn: "{{ secret('SENTRY_DSN') }}" # format: https://[email protected]/xxx
    endpointType: ENVELOPE

Send a custom Sentry alert

yaml
id: sentry_alert
namespace: company.team

tasks:
  - id: send_sentry_message
    type: io.kestra.plugin.notifications.sentry.SentryAlert
    dsn: "{{ secret('SENTRY_DSN') }}"
    endpointType: "ENVELOPE"
    payload: |
      {
          "timestamp": "{{ execution.startDate }}",
          "platform": "java",
          "level": "error",
          "transaction": "/execution/id/{{ execution.id }}",
          "server_name": "localhost:8080",
          "message": {
            "message": "Execution {{ execution.id }} failed"
          },
          "extra": {
            "Namespace": "{{ flow.namespace }}",
            "Flow ID": "{{ flow.id }}",
            "Execution ID": "{{ execution.id }}",
            "Link": "http://localhost:8080/ui/executions/{{flow.namespace}}/{{flow.id}}/{{execution.id}}"
          }
      }
Properties
Min length 1

Sentry DSN

Default ENVELOPE
Possible Values
ENVELOPESTORE

Sentry endpoint type

Options

The options to set to customize the HTTP client

Sentry event payload

Format duration

The time allowed to establish a connection to the server before failing.

Default PT0S
Format duration

The time an idle connection can remain in the client's connection pool before being closed.

Default UTF-8

The default charset for the request.

SubType string

HTTP headers

HTTP headers to include in the request

Default 10485760

The maximum content length of the response.

Default PT5M
Format duration

The time allowed for a read connection to remain idle before closing it.

Default PT10S
Format duration

The maximum time allowed for reading data from the server before failing.