Support alert create/update/remove/enable/disable in the CLI#475
Support alert create/update/remove/enable/disable in the CLI#475amannix-ro wants to merge 7 commits into
Conversation
Assisted-By: Claude:claude-fable-5
Assisted-By: Claude:claude-opus-4.8
Assisted-By: Claude:claude-opus-4.8
|
Looks like we'll need to run E2E tests against a preview container for alerts |
KodrAus
left a comment
There was a problem hiding this comment.
Looking better. The Superpower parser needs a closer look
Assisted-By: Claude:claude-opus-4.8
Assisted-By: Claude:claude-opus-4.8
|
Needs a final run through and cleanup now before marking as ready. |
|
|
||
| Options.Add( | ||
| "notification-level=", | ||
| "The level of the notifications raised by the alert, for example `Warning` or `Error`", |
There was a problem hiding this comment.
Without the default documented, I'd always end up specifying this.
| var config = RuntimeConfigurationLoader.Load(_storagePath); | ||
| var connection = SeqConnectionFactory.Connect(_connection, config); | ||
|
|
||
| var toUpdate = _entityIdentity.Id != null ? [await connection.Alerts.FindAsync(_entityIdentity.Id)] |
There was a problem hiding this comment.
The Seq UI uses AlertStateEntity, rather than AlertEntity, to retrieve basic summaries of non-shared alerts for all users and thus allow admins to disable a non-shared alert that they do not own (via "removing" the AlertStateEntity).
We don't necessarily need to support the same thing here, but worth noting. (It'd be especially nice, at some point, to support username scoping in cases like this, so that I could disable "nblumhardt/Some Noisy Alert" and not need to split out the username.)
This PR adds CRUD CLI support for alerts. Details of what commands are supported are in the updated README.
I haven't added support for fetching alert notifications here, but is something we could consider too.
AI Disclosure: This work was assisted by cloud agentic tooling. I've reviewed and further modified the result.