Hi Christian ,

Thank you for helping me on this. For some reason, I am not able to drop
these global labels .
I tried config as mentioned in link you shared .

For more information , there are more global labels (such as environment,
cluster , etc) apart from replica .

Do I need to remove other global variables and maintain only one label as
replica .

I also tried with options given below ( from the link :
https://github.com/prometheus/prometheus/issues/3239 )

alerting:
  alert_relabel_configs:
    - action: drop
      source_labels: [replica]
      regex: '1'

Please advise , thanks

Is it possible to query alertmanager alerts like metrics in prometheus ?
Like http:/server:9093/mertrics or something else .

Thanks,
Sunil Sagar

On Thu, Mar 26, 2020 at 5:37 AM Christian Hoffmann <
[email protected]> wrote:

> Hi,
>
> you seem to be using external_labels without alert_relabel_configs to
> drop this label from your alerts again. Therefore, your alerts will have
> different labels and will not be de-duplicated.
>
> See this blog post:
>
> https://www.robustperception.io/high-availability-prometheus-alerting-and-notification
>
> It has an example for the dc label (where you would need replica).
>
> Kind regards,
> Christian
>
> On 3/25/20 5:17 AM, sunil sagar wrote:
> > Hi ,
> >
> > I have Prometheus environment in HA mode . And AlertManager is also in
> > HA mode .
> > I am receiving duplicate alerts .
> > When I start both the prometheus , because of global label with
> > different replica name , getting duplicate alert . Please advise.
> >
> > Prometheus Config:
> >
> > Prometheus Node1:
> > global:
> >    external_labels:
> >       replica: 1
> >
> > alerting:
> >   alertmanagers:
> >      -static_configs:
> >          - targets:
> >               - alertmanager1:9093
> >               - alertmanager2:9093
> >
> > ------------------------------------------------------
> > Prometheus Node2:
> > global:
> >    external_labels:
> >       replica: 1
> >
> > alerting:
> >   alertmanagers:
> >      -static_configs:
> >          - targets:
> >               - alertmanager1:9093
> >               - alertmanager2:9093
> > -------------------------------------------------------------
> > Sample AlertManager rule:
> > expr: max(up == 0 ) by (host)
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Prometheus Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to [email protected]
> > <mailto:[email protected]>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/prometheus-users/c1b788da-59c0-439c-8fc2-d1ded5f0bf46%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/prometheus-users/c1b788da-59c0-439c-8fc2-d1ded5f0bf46%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CANegE50uJc2rCk-9axLF1WATWorw8%2B_izb12o3Wqet5i3x9UjA%40mail.gmail.com.

Reply via email to