SentryAlert
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.
type: "io.kestra.plugin.notifications.sentry.SentryAlert"
Send a Sentry alert on a failed flow execution
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
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}}"
}
}
YES
1
Sentry DSN
YES
ENVELOPE
ENVELOPE
STORE
Sentry endpoint type
YES
Options
The options to set to customize the HTTP client
YES
Sentry event payload
YES
duration
The time allowed to establish a connection to the server before failing.
YES
PT0S
duration
The time an idle connection can remain in the client's connection pool before being closed.
YES
UTF-8
YES
10485760
YES
PT5M
duration
The time allowed for a read connection to remain idle before closing it.
YES
PT10S
duration
The maximum time allowed for reading data from the server before failing.