Hi,
On 4/25/20 3:30 AM, sunil sagar wrote:
> I am working on alert-manager , very new to this .
> I want to write query for if data is not received on certain topic/feed
> within one hour , it should send mail to a particular group , such kind
> of alerting mechanism I have to implement .
This sounds like you want to do two things.
First, you will need to generate Alerts somehow. This is not done by
Alertmanager. As you are on the Prometheus mailing list, I suppose you
will be using Prometheus for that.
Here are some ressources for that:
https://prometheus.io/docs/prometheus/latest/getting_started/
https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
https://prometheus.io/docs/alerting/overview/
https://prometheus.io/docs/alerting/configuration/#route
https://prometheus.io/docs/alerting/configuration/#email_config
Basically you want to set up Prometheus which scrapes your target. This
provides you with the metrics you need (I'm thinking of some
yourapp_data_last_received_timestamp_seconds).
Then, you can configure Prometheus to generate an alert if this
timestamp is too old.
Your Prometheus server will have to be configured to send its alerts to
alertmanager.
Alertmanager will then decide where to send your alert based on its
routes. The target is called a receiver. You can configure a receiver
which sends mail to a specific group.
I suggest working through these steps and coming back once you hit any
obstacles or problems.
We would then need some more details, e.g. specific error messages,
metric names, config excerpts, etc.
Kind regards,
Christian