I'm not sure I really understand what you are asking due to your
mentioning of logs.
Are you saying that you are using an exporter (for example mtail) which
is consuming logs and then generating metrics?
When you create an alerting rule in Prometheus it performs the PromQL
query given, and if there are any results an alert is fired. Once the
PromQL query stops returning results (or has a different set of time
series being returned) the alert is resolved.
So for example if you had a simple query that said "alert if the number
of error logs [stored in a counter metric] increases by 5 or more in the
last 5 minutes" as soon as the metric returned an increase of at least 5
over the last 5 minutes it would fire. It would then continue to fire
until that is no longer true - so if the counter kept recording error
log lines such that the increase was still over 5 per 5 minutes it would
keep firing. It would only resolve once there were no more than 5 new
long lines recorded over the past 5 minutes.
Alertmanager just routes alerts that are generated within Prometheus to
other notification/processing systems, such as email or webhooks. It
would normally fire the webhook once the alert starts firing, and then
periodically (if it keeps firing, at a configurable interval) and then
finally (optionally) once it resolves. This is a one-way process -
nothing about the notification has any impact on the alert firing or
not. Only the PromQL query controls the alert.
I'm not sure if that helps.
--
Stuart Clark