SentryAlert
SentryAlert
type: "io.kestra.plugin.notifications.sentry.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.
Examples
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://xxx@xxx.ingest.sentry.io/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}}"
}
}
Properties
dsn
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Min length:
1
Sentry DSN
endpointType
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
ENVELOPE
- Possible Values:
ENVELOPE
STORE
Sentry endpoint type
payload
- Type: string
- Dynamic: ✔️
- Required: ❌
Sentry event payload
Outputs
Definitions
Was this page helpful?