feat(notifier): add process_writes WAL trigger entry point#74
feat(notifier): add process_writes WAL trigger entry point#74
Conversation
…etadata to onwrite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ub architecture Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| """ | ||
| { | ||
| "plugin_type": ["http"] | ||
| "plugin_type": ["http", "onwrite"] |
There was a problem hiding this comment.
we need to add a section with possible arguments for onwrite so that the UI can display
There was a problem hiding this comment.
Since we now also require an args setting for request, we need to add a section for it as well. I honestly don't remember what it should be called for the HTTP trigger type; I'll check with the team
There was a problem hiding this comment.
must be http_args_config
There was a problem hiding this comment.
I checked with the team, the UI doesn't support this parameter yet, but they'll fix it
|
|
||
| | Argument | Required | Description | | ||
| |-------------------|----------|----------------------------------------------------------| | ||
| | `sender_type` | yes | Must be `"slack"` | |
There was a problem hiding this comment.
I think sender_type should be in the contract table
There was a problem hiding this comment.
In this case, we'll be able to use a single trigger for several possible sending paths at once. Currently, the configuration is limited to one channel per trigger. To configure several channels at once, we need to pass not just one channel in the webhook_url_env arguments, but split them into separate ones (slack_webhook_url_env, sms_webhook_url_env, whatsapp_webhook_url_env, http_webhook_url_env). This will give us a single trigger that supports multiple channels simultaneously.
| influxdb3_local.info(f"[{task_id}] Starting request process") | ||
|
|
||
| # New mode: sender_type in args — credentials from env vars, body has notification_text only | ||
| if args and "sender_type" in args: |
There was a problem hiding this comment.
It's the same here, I think it's better to leave sender_type in the request body
| |---------------------|--------------|----------|--------------------------------------------------------------------------| | ||
| | `time` | timestamp | yes | When the alert fired (set automatically by InfluxDB on write) | | ||
| | `notification_text` | string field | yes | The notification message to dispatch | | ||
| | `id` | string field | no | Unique ID for this alert instance (set by the alert plugin) | |
There was a problem hiding this comment.
I think we need to specify the ID somewhere else in the logs, not just in the case of a skip. So that we can track which specific message is being processed
Summary
process_writesWAL trigger entry point to the notifier plugin, enabling pub-sub notification dispatch when rows are written to a tableprocess_requestfor env-var-based credential resolution via trigger args (*_envpattern)asyncio.gather()in a single event loopprocess_requestlegacy code path and all sender functions are completely untouched — no breaking changesDesign
Add a WAL trigger entry point (
process_writes) to the notifier plugin so it can send notifications both when it receives an HTTP request and when lines are written to a table. The table acts as a pub-sub notification channel: alert plugins publish rows, notifier triggers subscribe and dispatch. Secrets never touch the table — each notifier resolves its own credentials from environment variables, referenced by name through trigger args.Goals
process_requestlegacy code pathNon-Goals
Architecture
The table is a notification channel (pub-sub message bus):