id: seatunnel-job-failure-and-cluster-health-sentinel
namespace: company.data
inputs:
- id: seatunnel_host
type: STRING
displayName: SeaTunnel Coordinator Host
defaults: "seatunnel-coordinator.internal"
description: Hostname or IP address of the Apache SeaTunnel Zeta Engine coordinator.
- id: seatunnel_port
type: INT
displayName: SeaTunnel REST API Port
defaults: 8080
description: Port number for the SeaTunnel Zeta Engine REST API V2 (default 8080).
- id: slack_channel
type: STRING
displayName: Slack Channel
defaults: "#data-platform-alerts"
description: Slack channel destination for operational pipeline incident cards.
- id: inspect_cluster_overview
type: BOOL
displayName: Inspect Cluster Overview on Failure
defaults: true
description: Automatically query /overview to inspect cluster worker slots when
failed jobs are detected.
triggers:
- id: every_fifteen_minutes
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/15 * * * *"
tasks:
- id: probe_failed_jobs
type: io.kestra.plugin.core.http.Request
uri: "http://{{ inputs.seatunnel_host }}:{{ inputs.seatunnel_port
}}/finished-jobs/FAILED"
method: GET
headers:
Accept: application/json
options:
allowFailed: true
allowFailure: true
- id: route_by_job_health
type: io.kestra.plugin.core.flow.Switch
value: >-
{% if outputs.probe_failed_jobs.status != 200 or
outputs.probe_failed_jobs.body is null %} PROBE_FAILED {% else %}
{% set jobs = outputs.probe_failed_jobs.body %}
{% if jobs is iterable and jobs | length > 0 %}
CRITICAL
{% else %}
HEALTHY
{% endif %}
{% endif %}
cases:
CRITICAL:
- id: alert_critical_slack
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"channel": "{{ inputs.slack_channel }}",
"text": "[CRITICAL] Apache SeaTunnel Ingestion Job Failures Detected - Data Landing Halted",
"attachments": [
{
"color": "#D32F2F",
"title": "Apache SeaTunnel Job Failure Incident",
"fields": [
{
"title": "Coordinator Endpoint",
"value": "{{ inputs.seatunnel_host }}:{{ inputs.seatunnel_port }}",
"short": true
},
{
"title": "Failed Jobs Count",
"value": "{{ outputs.probe_failed_jobs.body | length }}",
"short": true
},
{
"title": "Severity",
"value": "CRITICAL - Integration Pipeline Failed",
"short": true
},
{
"title": "Inspect Overview",
"value": "{{ inputs.inspect_cluster_overview ? 'Enabled' : 'Disabled' }}",
"short": true
}
],
"footer": "Kestra SeaTunnel Sentinel | Execution ID: {{ execution.id }}"
}
]
}
- id: check_cluster_overview
type: io.kestra.plugin.core.flow.If
condition: "{{ inputs.inspect_cluster_overview == true }}"
then:
- id: query_cluster_overview
type: io.kestra.plugin.core.http.Request
uri: "http://{{ inputs.seatunnel_host }}:{{ inputs.seatunnel_port }}/overview"
method: GET
headers:
Accept: application/json
options:
allowFailed: true
- id: log_cluster_overview
type: io.kestra.plugin.core.log.Log
message: "SeaTunnel Zeta cluster overview diagnostics: {{
outputs.query_cluster_overview.body }}"
PROBE_FAILED:
- id: alert_probe_failure
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"channel": "{{ inputs.slack_channel }}",
"text": "[CRITICAL] SeaTunnel Sentinel Probe Failed - Unable to query /finished-jobs/FAILED. Verify coordinator endpoint and port 8080 routing."
}
HEALTHY:
- id: log_jobs_healthy
type: io.kestra.plugin.core.log.Log
message: "SeaTunnel Zeta cluster job execution health is normal. No failed data
integration jobs detected."
- id: log_audit_summary
type: io.kestra.plugin.core.log.Log
message: "SeaTunnel job health audit completed. Status: {{
outputs.route_by_job_health.value ?? 'PROCESSED' }}."
errors:
- id: on_flow_failure
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"channel": "{{ inputs.slack_channel }}",
"text": "[ERROR] Apache SeaTunnel Sentinel flow execution aborted unexpectedly. Execution ID: {{ execution.id }}."
}