Hi,
   We have a use case where we want to send alerts to Prometheus
Alertmanager (https://prometheus.io/docs/alerting/latest/alertmanager/)
from Flink. Each of these alerts have a startsAt, endsAt field along with
alertMetadata. Alertmanager expects clients to send all the FIRING alerts
every X minutes (X is configurable) with an updated endsAt time (greater
than X since alertmanager would drop the alert once endsAt time is reached)
and once the alert is in RESOLVED state stop sending it. The state updates
of the alerts would come from Kafka. So the pipeline is something like this
State Updates to Alerts (Kafka) -> Flink (Some Enrichment) -> Alertmanager
Sink
 They provide a rest endpoint where we can post these alerts. I have some
questions to see if its achievable to develop a sink connector for
alertmanager in flink?

1. Is it possible to send data to a sink every X minutes from a custom sink
connector since I have to somehow simulate a behavior of continuously
sending the same alerts even because state updates are only received from
Kafka for FIRING -> RESOLVED state and not for FIRING -> FIRING state? I
was thinking of having a state of active alerts and somehow the sink
connector would get the state every X minutes, batch it and then send it to
alertmanager. However, I am not able to find resources to write some
implementation around it.

2. In Flink 1.15, there are Async Sinks (
https://cwiki.apache.org/confluence/display/FLINK/FLIP-171%3A+Async+Sink)
but not much documentation around. Also don't know if it would be
achievable to write the continuous firing logic in alertmanager

Any other ideas are welcomed.

-- 
*Thanks,*
*Dhruv*

Reply via email to