Documentation
¶
Overview ¶
Package notify warns when a run fails.
It exists because it was the biggest gap against Kestra: the 51 flows in that repository each carried the SAME copied `errors: alert_slack` block -- twenty lines of payload repeated fifty times. Here the alert is a property of the INSTALLATION: configure the webhook once and every workflow starts warning, with the option to silence one.
The webhook does not come from the workflow's YAML, on purpose. It is a credential: whoever has the URL posts in the channel as if they were the platform, and a pipeline file is no place for that.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶ added in v0.7.0
type Alert struct {
Workflow string
RunID string
Status string
Trigger string
Attempts int
LogicalDate *time.Time
Err string
// Step is the node that failed. It arrives as a field of its own, and not
// only embedded in the error text, because it is the first thing whoever is
// on call looks for: "which step?" before "why?".
Step string
// LogExcerpt is the last few lines of that step's output, read from
// `task_runs.log`. Without it the alert says something failed; with it the
// alert says what failed and why, without anyone opening the screen at
// 4am.
LogExcerpt string
// The workflow's tags become the message's "Domain" and "Pipeline" fields --
// in Kestra that came from `labels`, and it is what makes an alert
// actionable without opening the screen.
Tags []string
// BaseURL of the UI, for the run's direct link. Empty means no link.
BaseURL string
}
Alert is what gets told about a failure.
type Notificador ¶
Notificador sends the alert. A small interface so the dispatcher knows nothing of Slack -- and so the test needs no network.