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}}"
}
}
Sentry DSN
Sentry endpoint type
Options
The options to set to customize the HTTP client
Sentry event payload
The time allowed to establish a connection to the server before failing.
The time an idle connection can remain in the client's connection pool before being closed.
The default charset for the request.
The maximum content length of the response.
The time allowed for a read connection to remain idle before closing it.
The maximum time allowed for reading data from the server before failing.