That command is only intended for testing. Alerts aren't a one-off API
call from Prometheus to Alertmanager. Instead Prometheus will repeatedly
call every single Alertmanager periodically until the alert is cleared.
If Alertmanager stops receiving these updates it will mark the alert as
resolved.
Alerts in the Prometheus world are triggered based on the evaluation of
alerting rules, which themselves are queries which interrogate metrics.
Therefore every alert would be based on some sort of source metric
(there are a few exceptions, such as having an alert which always fires
to check the alerting pipeline for example).
For one of the example use cases you gave you said an alert should be
triggered if an event happens. Prometheus itself isn't an event system,
but you can create metrics from events. So in that case you'd have a
metric that could be a counter of the number of events that have
happened. Then your alert would fire when that value increases (for
example).
Are you able to give some more information on what use cases you are
trying to handle?
--
Stuart Clark