Tell someone when the engine breaks
Everything that goes wrong already travelled the event bus, but the only subscriber was the editor's websocket — so a flow quarantined at three in the morning was invisible until someone opened the browser. An alert manager now watches the same bus and forwards failures to ntfy, email or a webhook. Most of what it does is decline to send: the same node failing every second is one alert with a count of what followed, a connection flapping up and down is muted until it settles, and nothing gets past ten notifications an hour. Verified against a live instance — six identical failures produced one alert carrying the real traceback message. Channels and rules are configured through the API, with a test send so a channel can be proven before anything depends on it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011LF61rxW1FG5YCD2J9YqjY
This commit is contained in:
@@ -1,5 +1,32 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export const AlertsConfigSchema = {
|
||||
properties: {
|
||||
enabled: {
|
||||
type: 'boolean',
|
||||
title: 'Enabled',
|
||||
default: true
|
||||
},
|
||||
channels: {
|
||||
items: {
|
||||
'$ref': '#/components/schemas/Channel'
|
||||
},
|
||||
type: 'array',
|
||||
title: 'Channels'
|
||||
},
|
||||
rules: {
|
||||
items: {
|
||||
'$ref': '#/components/schemas/Rule'
|
||||
},
|
||||
type: 'array',
|
||||
title: 'Rules'
|
||||
}
|
||||
},
|
||||
type: 'object',
|
||||
title: 'AlertsConfig',
|
||||
description: 'The whole alerting setup, as stored and as the API sees it.'
|
||||
} as const;
|
||||
|
||||
export const Body_login_login_access_tokenSchema = {
|
||||
properties: {
|
||||
grant_type: {
|
||||
@@ -135,6 +162,34 @@ export const Body_oauth_tokenSchema = {
|
||||
title: 'Body_oauth-token'
|
||||
} as const;
|
||||
|
||||
export const ChannelSchema = {
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
title: 'Name'
|
||||
},
|
||||
kind: {
|
||||
type: 'string',
|
||||
enum: ['ntfy', 'smtp', 'webhook'],
|
||||
title: 'Kind'
|
||||
},
|
||||
enabled: {
|
||||
type: 'boolean',
|
||||
title: 'Enabled',
|
||||
default: true
|
||||
},
|
||||
config: {
|
||||
additionalProperties: true,
|
||||
type: 'object',
|
||||
title: 'Config'
|
||||
}
|
||||
},
|
||||
type: 'object',
|
||||
required: ['name', 'kind'],
|
||||
title: 'Channel',
|
||||
description: 'Somewhere to send an alert.'
|
||||
} as const;
|
||||
|
||||
export const DTypeSchema = {
|
||||
type: 'string',
|
||||
enum: ['float', 'int', 'str', 'bool', 'json'],
|
||||
@@ -1013,6 +1068,33 @@ export const RenameRequestSchema = {
|
||||
title: 'RenameRequest'
|
||||
} as const;
|
||||
|
||||
export const RuleSchema = {
|
||||
properties: {
|
||||
events: {
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
type: 'array',
|
||||
title: 'Events'
|
||||
},
|
||||
channels: {
|
||||
items: {
|
||||
type: 'string'
|
||||
},
|
||||
type: 'array',
|
||||
title: 'Channels'
|
||||
},
|
||||
cooldown_s: {
|
||||
type: 'number',
|
||||
title: 'Cooldown S',
|
||||
default: 900
|
||||
}
|
||||
},
|
||||
type: 'object',
|
||||
title: 'Rule',
|
||||
description: 'Which events go to which channels.'
|
||||
} as const;
|
||||
|
||||
export const RunRequestSchema = {
|
||||
properties: {
|
||||
inputs: {
|
||||
|
||||
Reference in New Issue
Block a user